我遇到了两个非常相似的问题,但那里的答案显然不适用于我的问题所以我得出结论我得到了同样的错误,但原因不同。
基本上,我安装了rspec-rails和cucumber-rails,但我似乎无法说服“rake cucumber”这个。
chuckhoffman@Lucky-Charm:~/projects/siteman/current(rspec)$ rake cucumber
(in /Users/chuckhoffman/projects/siteman/releases/siteman)
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead. (called from /Users/chuckhoffman/.rvm/gems/ruby-1.8.7-p334@rails2/gems/activesupport-2.3.11/lib/activesupport.rb:2)
[FSTR] Using Red Five FileStorage version 0.1
/Users/chuckhoffman/.rvm/rubies/ruby-1.8.7-p334/bin/ruby -I "/Users/chuckhoffman/.rvm/gems/ruby-1.8.7-p334@rails2/gems/cucumber-0.10.0/lib:lib" "/Users/chuckhoffman/.rvm/gems/ruby-1.8.7-p334@rails2/gems/cucumber-0.10.0/bin/cucumber" --profile default
Using the default profile...
[FSTR] Using Red Five FileStorage version 0.1
Missing these required gems:
cucumber-rails >= 0.3.2
rspec-rails >= 1.3.2
You're running:
ruby 1.8.7.334 at /Users/chuckhoffman/.rvm/rubies/ruby-1.8.7-p334/bin/ruby
rubygems 1.6.2 at /Users/chuckhoffman/.rvm/gems/ruby-1.8.7-p334@rails2, /Users/chuckhoffman/.rvm/gems/ruby-1.8.7-p334@global
Run `rake gems:install` to install the missing gems.
rake aborted!
Command failed with status (1): [/Users/chuckhoffman/.rvm/rubies/ruby-1.8.7...]
(See full trace by running task with --trace)
chuckhoffman@Lucky-Charm:~/projects/siteman/current(rspec)$ gem list cucumber-rails
*** LOCAL GEMS ***
cucumber-rails (0.3.2)
chuckhoffman@Lucky-Charm:~/projects/siteman/current(rspec)$ gem list rspec-rails
*** LOCAL GEMS ***
rspec-rails (1.3.3, 1.3.0)
chuckhoffman@Lucky-Charm:~/projects/siteman/current(rspec)$ ls vendor/gems
ls: vendor/gems: No such file or directory
正如你所看到的,宝石列表报告了黄瓜告诉我缺少的确切版本,而且我没有供应商的宝石。我也在新生成的新Rails 2.3.11应用程序中尝试了它,结果相同。那是什么给出了什么?
答案 0 :(得分:1)
首先,看起来您正在运行旧版本的RVM,更新可能有所帮助。其次,看起来你有一个rails2 gemset,如果你要安装到一个gemset但你的应用程序正在使用另一个gemset,这可能会导致一些gem不匹配。最后,您应该使用Bundler来管理应用程序中的gem,因为它解决了很多这类问题。