0
votes

In the process if trying to manage and update my ruby environment through rbenv on OS X Mavericks (upgrading from 2.0.0p45 to 2.1.1), I've got a bit of a mess in a preexisting project.

When I try to run cucumber, for example, I get

localhost: cucumber /Users/me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in 'to_specs': Could not find 'cucumber' (>= 0) among 9 total gem(s) (Gem::LoadError) from /Users/me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in 'to_spec' from /Users/me/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in 'gem' from /usr/bin/cucumber:22:in '<main>'

Running

gem environment

shows me

- RUBYGEMS VERSION: 2.2.2 - RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-darwin13.0] - INSTALLATION DIRECTORY: /Users/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0 - RUBY EXECUTABLE: /Users/me/.rbenv/versions/2.1.1/bin/ruby

But in in the gems folder inside /2.1.0, I only have:

rake-10.1.0 rake-10.3.2 rdoc-4.1.0 test-unit-2.1.1.0

Bundler is installing things into

/Users/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/ruby/2.0.0/gems/

even with specified with --path to the precise directory given by gem environment.

How can I get the gems to install correctly so that cucumber works?

I tried bundle exec cucumber and got:

Could not find rake-10.3.2 in any of the sources Run 'bundle install' to install missing gems.

1

1 Answers

0
votes

I'm not entirely certain what was happening here, but this answer on a similar question did the trick. I suspect that bundler was not rehashed correctly to the different version of ruby shimmed in by rbenv.