在此过程中如果尝试通过OS X Mavericks上的rbenv管理和更新我的ruby环境(从2.0.0p45升级到2.1.1),我在预先存在的项目中有点乱。 / p>
例如,当我尝试运行黄瓜时,我得到了
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>'
运行
gem environment
告诉我
- 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
但是在/2.1.0里面的gems文件夹中,我只有:
rake-10.1.0 rake-10.3.2 rdoc-4.1.0 test-unit-2.1.1.0
Bundler正在安装内容
/Users/me/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/ruby/2.0.0/gems/
即使使用--path
指定gem environment
指定的精确目录。
如何正确安装宝石以便黄瓜可以正常工作?
我尝试了bundle exec cucumber
并得到了:
Could not find rake-10.3.2 in any of the sources
Run 'bundle install' to install missing gems.