1
votes

When I run bundle, I get the following:

-bash: bundle: command not found

I'm not a ruby developer, but it seems like I need bundler to get some software running other people wrote. So I'm trying to get bundler using gem install bundler, but I get the following error:

ERROR:  While executing gem ... (ArgumentError)
    wrong number of arguments (given 4, expected 1)

Using --backtrace

ERROR:  While executing gem ... (ArgumentError)
    wrong number of arguments (given 4, expected 1)
        /var/lib/gems/2.5.0/gems/psych-4.0.1/lib/psych.rb:323:in `safe_load'
        /usr/lib/ruby/2.5.0/rubygems/safe_yaml.rb:31:in `safe_load'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:496:in `block (2 levels) in read_checksums'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:495:in `wrap'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:495:in `block in read_checksums'
        /usr/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:116:in `seek'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:494:in `read_checksums'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:547:in `block (2 levels) in verify'
        /usr/lib/ruby/2.5.0/rubygems/package/tar_reader.rb:29:in `new'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:546:in `block in verify'
        /usr/lib/ruby/2.5.0/rubygems/package/file_source.rb:30:in `open'
        /usr/lib/ruby/2.5.0/rubygems/package/file_source.rb:30:in `with_read_io'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:545:in `verify'
        /usr/lib/ruby/2.5.0/rubygems/package.rb:526:in `spec'
        /usr/lib/ruby/2.5.0/rubygems/source/local.rb:49:in `block in load_specs'
        /usr/lib/ruby/2.5.0/rubygems/source/local.rb:43:in `each'
        /usr/lib/ruby/2.5.0/rubygems/source/local.rb:43:in `load_specs'
        /usr/lib/ruby/2.5.0/rubygems/source/local.rb:83:in `find_gem'
        /usr/lib/ruby/2.5.0/rubygems/resolver/installer_set.rb:141:in `find_all'
        /usr/lib/ruby/2.5.0/rubygems/resolver/installer_set.rb:56:in `add_always_install'
        /usr/lib/ruby/2.5.0/rubygems/dependency_installer.rb:478:in `resolve_dependencies'
        /usr/lib/ruby/2.5.0/rubygems/commands/install_command.rb:194:in `install_gem'
        /usr/lib/ruby/2.5.0/rubygems/commands/install_command.rb:255:in `block in install_gems'
        /usr/lib/ruby/2.5.0/rubygems/commands/install_command.rb:251:in `each'
        /usr/lib/ruby/2.5.0/rubygems/commands/install_command.rb:251:in `install_gems'
        /usr/lib/ruby/2.5.0/rubygems/commands/install_command.rb:158:in `execute'
        /usr/lib/ruby/2.5.0/rubygems/command.rb:313:in `invoke_with_build_args'
        /usr/lib/ruby/2.5.0/rubygems/command_manager.rb:173:in `process_args'
        /usr/lib/ruby/2.5.0/rubygems/command_manager.rb:143:in `run'
        /usr/lib/ruby/2.5.0/rubygems/gem_runner.rb:59:in `run'
        /usr/bin/gem:21:in `<main>'
  • ruby version: ruby 2.5.5p157 (2019-03-15 revision 67260) [arm-linux-gnueabihf].
  • gem version: 2.7.6.2
  • I'm on a raspbian linux.
1
Not sure if something like rvm or rbenv works on Rapberry PI, but if it does, try installing a ruby via one of those instead of using the system rubyAnkit
It looks like you may have a version incompatibility between Psych and Ruby, if there is a line in your Gemfile relating to Psych, try removing it as it should come with Ruby.matthew.tuck

1 Answers

0
votes

Psych Gem was the culprit in my case; uninstalling psych before running any bundler/gem commands fixed it for me:

Before:

$ bundle update rails
[SNIP]
ArgumentError: wrong number of arguments (given 4, expected 1)
An error occurred while installing activesupport (6.0.4.1), and Bundler cannot continue.
Make sure that `gem install activesupport -v '6.0.4.1' --source 'https://rubygems.org/'` succeeds before bundling.


$ gem install activesupport -v '6.0.4.1' --source 'https://rubygems.org/' --backtrace
ERROR:  While executing gem ... (ArgumentError)
    wrong number of arguments (given 4, expected 1)
        /home/local/PDC01/swi/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/psych-4.0.1/lib/psych.rb:323:in `safe_load'
        /home/local/PDC01/swi/.asdf/installs/ruby/2.5.3/lib/ruby/2.5.0/rubygems/safe_yaml.rb:31:in `safe_load'
[SNIP]

Fix:

$ gem uninstall psych

Select gem to uninstall:
 1. psych-3.3.0
 2. psych-4.0.1
 3. All versions
> 3

After:

...

$ gem install activesupport -v '6.0.4.1' --source 'https://rubygems.org/' 

Successfully installed activesupport-6.0.4.1
Parsing documentation for activesupport-6.0.4.1