Gem install wrong number of arguments (given 4, expected 1) - ruby

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.

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

Running gem update --system should fix things since recent RubyGems versions should be compatible with both Psych 3 and Psych 4.

I have a rails application running with rails-6.1.6 and ruby-3.1.2. I was able to get rid of this exact error by explicitly declaring and downgrading the psych gem (was 4.0.4):
gem 'psych', '~> 3.3.2'

Related

How do I resolve this error while installing Jekyll?

I followed this page and installed Jekyll, but when I tried to run Jekyll I got this error:
/usr/local/lib/site_ruby/2.1.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'liquid' (~> 2.5.5) - did find: [liquid-3.0.1,liquid-2.6.1] (Gem::LoadError)
Checked in 'GEM_PATH=/home/ali/.gem/ruby/2.1.0:/var/lib/gems/2.1.0:/usr/share/rubygems-integration/2.1.0:/usr/share/rubygems-integration/2.1:/usr/share/rubygems-integration/all', execute `gem env` for more information
from /usr/local/lib/site_ruby/2.1.0/rubygems/specification.rb:1311:in `block in activate_dependencies'
from /usr/local/lib/site_ruby/2.1.0/rubygems/specification.rb:1300:in `each'
from /usr/local/lib/site_ruby/2.1.0/rubygems/specification.rb:1300:in `activate_dependencies'
from /usr/local/lib/site_ruby/2.1.0/rubygems/specification.rb:1282:in `activate'
from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
from /usr/local/bin/jekyll:22:in `<main>'
This error indicates that the version of the liquid Gem that jekyll needs is lower than the ones you have installed. You should look into installing the right version which is v2.5.5.
gem install liquid -v 2.5.5
Should fix this.

Rake aborted: could not find rspec

I'm trying to work through the Ruby course from TestFirst.org. It requires you to navigate to the folder containing the exercise, run rake, and then correct any errors in the source code it uncovers. When I run rake in the folder for the first exercise it gives this error:
rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0, rspec-core-3.0.0,
rspec- expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
Does this means it will only work with an old version of rspec or something else? Running rake with --trace gives me:
rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0,
rspec-core-3.0.0, rspec-expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:589:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:89:in `block in load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:88:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:72:in `block in run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:70:in `run'
/usr/bin/rake:27:in `<main>'
How do I get the rake command to work properly? I'm using Terminal in Ubuntu 14.04, with Ruby 1.9.3, RubyGems 1,8.23, and Rspec 3.0.0. Thanks in advance.
I had the same problem, and sudo gem install -v '<3.0.0' rspec did work, but only after I uninstalled the newer version with gem uninstall rspec.
Without that uninstall first, only the later version remains active and the problem will continue.
hope this help.
gem install rspec -v 2.9.0
It happen because:
Could not find rspec (~> 2)
while rspec version installed on your machine is: rspec-3.0.0
Source: RubyGems

irb builds nokogiri for no apparent reason

I'm in Ubuntu 14.04 using ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
I type irb and suddenly I get the following
/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1 (Errno::EACCES)
from /usr/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:210:in `write_gem_make_out'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:132:in `build_error'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:171:in `rescue in build_extension'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:156:in `build_extension'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `each'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1436:in `block in build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/user_interaction.rb:45:in `use_ui'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1434:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `each'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:185:in `try_activate'
from /usr/lib/ruby/1.9.1/irb/locale.rb:150:in `block in search_file'
from /usr/lib/ruby/1.9.1/irb/locale.rb:158:in `block in each_localized_path'
from /usr/lib/ruby/1.9.1/irb/locale.rb:167:in `each_sublocale'
from /usr/lib/ruby/1.9.1/irb/locale.rb:157:in `each_localized_path'
from /usr/lib/ruby/1.9.1/irb/locale.rb:145:in `search_file'
from /usr/lib/ruby/1.9.1/irb/locale.rb:124:in `find'
from /usr/lib/ruby/1.9.1/irb/locale.rb:108:in `load'
from /usr/lib/ruby/1.9.1/irb/locale.rb:32:in `initialize'
from /usr/lib/ruby/1.9.1/irb/init.rb:114:in `new'
from /usr/lib/ruby/1.9.1/irb/init.rb:114:in `init_config'
from /usr/lib/ruby/1.9.1/irb/init.rb:16:in `setup'
from /usr/lib/ruby/1.9.1/irb.rb:53:in `start'
from /usr/bin/irb:12:in `<main>'
So here's the /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/ folder listing:
bcrypt-3.1.7 ffi-1.9.3 nokogiri-1.6.3.rc1 therubyracer-0.12.1
binding_of_caller-0.7.2 json-1.8.1 pg-0.17.1 unicorn-4.8.3
debug_inspector-0.0.2 kgio-2.9.2 raindrops-0.13.0
As you can see I already have nokogiri-1.6.3.rc1, but irb, without my asking, is trying to build nokogiri-1.6.2.1. I then add print statements to both /usr/lib/ruby/1.9.1/fileutils.rb:247:in 'fu_mkdir' and /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:210:in 'write_gem_make_out' to see what they're trying to do. I change ownership recursively to the current user for /var/lib/gems/. I then run irb and get the following.
Dir.mkdir /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri.
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Building libxslt-1.1.28 for nokogiri.
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxslt.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Dir.mkdir /var/lib/gems/1.9.1/gems/nokogiri-1.6.2.1/lib
FileUtils.mkdir_p /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
Dir.mkdir /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
I didn't ask for Nokogiri to build. At the moment I could care less about it. Why did it build Nokogiri without my asking? And why would irb stop me from continuing my work to do so?
irb works now. The /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/ folder now looks like
bcrypt-3.1.7 ffi-1.9.3 nokogiri-1.6.2.1 raindrops-0.13.0
binding_of_caller-0.7.2 json-1.8.1 nokogiri-1.6.3.rc1 therubyracer-0.12.1
debug_inspector-0.0.2 kgio-2.9.2 pg-0.17.1 unicorn-4.8.3
So now I have two versions of nokogiri. "Stop it irb! You're drunk!" In case you're wondering I had just now booted up my computer. Previously I had had an application build a customized Nokogiri instance. But I still don't know why this happened.

Jekyll won't load anymore after update

I made a clean install of my computer and so reinstall Ruby and Jekyll.
And seems like a big update happened and my old project won't load anymore. Here is what I have when I do a jekyll server
[Arnaud#TARDIS ~/Sites/arnaud scroll]$ jekyll server
Configuration file: /Users/Arnaud/Sites/arnaud/_config.yml
/Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- nokogiri (LoadError)
from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/Arnaud/Sites/arnaud/_plugins/firstPar.rb:1:in `<top (required)>'
from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:87:in `block (2 levels) in setup'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:86:in `each'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:86:in `block in setup'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:85:in `each'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:85:in `setup'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/site.rb:34:in `initialize'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:5:in `new'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:5:in `process'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/jekyll-1.0.2/bin/jekyll:83:in `block (2 levels) in <top (required)>'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/runner.rb:400:in `run_active_command'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
from /Users/Arnaud/.rvm/gems/ruby-2.0.0-p195#arnaud/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
Any idea ?
EDIT :
Here is the list of gems :
[Arnaud#TARDIS ~/Sites/arnaud scroll]$ gem list --all
*** LOCAL GEMS ***
bigdecimal (1.2.0)
bundler (1.3.5)
bundler-unload (1.0.1)
classifier (1.3.3)
colorator (0.1)
commander (4.1.3)
directory_watcher (1.4.1)
fast-stemmer (1.0.2)
highline (1.6.19)
io-console (0.4.2)
jekyll (1.0.2)
json (1.7.7)
kramdown (1.0.2)
liquid (2.5.0)
maruku (0.6.1)
minitest (4.3.2)
posix-spawn (0.3.6)
psych (2.0.0)
pygments.rb (0.5.0)
rake (10.0.4, 0.9.6)
rdoc (4.0.0)
rubygems-bundler (1.2.0)
rvm (1.11.3.8)
safe_yaml (0.7.1)
syntax (1.0.0)
test-unit (2.0.0.0)
yajl-ruby (1.1.0)
Try uninstall nokogiri (if installed) and redo everything. Ensure that sudo is not used during the installation (as your Jekyll was installed without sudo by gem install jekyll).
gem install nokogiri
Apparently there's something wrong with your setup. For example, the following error
/Users/Arnaud/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'jekyll' (>= 0) among 8 total gem(s) (Gem::LoadError)
shouldn't be happening in case the Jekyll gem was installed (or could at least be reached) correctly. (most of the Jekyll problems are related to lack of correct YAML front matter, to be honest)
If you pay attention to sudo gem list --all, you'll notice that jekyll isn't installed when you use sudo. Did you try:
gem install jekyll
jekyll serve
This should work, or at least give you a "better" error.
Ah, a good solution to avoid these errors (or at least control them easily) is to use RVM gemsets to separate your gems. It's very useful for debugging.

1.9.3 installed, error message factory_girl requires Ruby version >= 1.9.2

I just installed rbenv with ruby 1.9.3
rbenv version
1.9.3-p327 (set by /Users/me/.rbenv/version)
However, when I tried to run bundle update (inside a project that was created before rbenv was installed), I got an error message that factory_girl required at least ruby 1.9.2. See error message below
If it's relevant, when I do gem --version, I see a reference to 1.8.23.
gem --version
1.8.23
Error message
Installing factory_girl (4.1.0) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:163:in `install': factory_girl requires Ruby version >= 1.9.2. (Gem::InstallError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:268:in `update'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
Update:
The first answer told me to do three steps
gem install bundle
rbenv rehash
bundle install
I did those steps (it installed bundler) '
gem install bundler
Fetching: bundler-1.2.3.gem (100%)
Successfully installed bundler-1.2.3
1 gem installed
but when I tried 'bundle install, I got the same error message about Factory_girl. Interestingly, I decided to try those three steps again, beginning with gem install bunlder, and it installed it again?!#??
The bundle command you are using is from system Ruby installation which is Ruby 1.8.x.
Try
gem install bundler
rbenv rehash
bundle install
This should solve your problem.

Resources