黄瓜不起作用,但耙黄瓜确实有效

时间:2013-10-13 23:53:10

标签: ruby-on-rails ruby cucumber rake

Jonathans-MacBook-Air-2:hw3-rottenpotatoes Jonathan$ cucumber
WARN: Unresolved specs during Gem::Specification.reset:
      tzinfo (~> 0.3.37)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
You have already activated activesupport 4.0.0, but your Gemfile requires activesupport 3.2.14. Using bundle exec may solve this. (Gem::LoadError)
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/Users/Jonathan/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `'

但似乎我在这个目录中有正确的rails版本。

Jonathans-MacBook-Air-2:hw3-rottenpotatoes Jonathan$ rails --version
Rails 3.2.14

我对红宝石有点新鲜,并且为什么“耙黄瓜”有效但是“黄瓜”不在终端中而感到困惑。 我不知道如何设置红宝石和宝石,但我有一个预感是,不知何故在我的工作目录中,ruby被告知使用rails 3.2.14但命令“cucumber”只检测activtesupport 4.0.0(我相信与铁路有关)

非常感谢!

2 个答案:

答案 0 :(得分:0)

cucumber是binstub,而rake cucumber是执行库的rake任务。

先尝试bundle install -—binstubs,然后尝试cucumber

也许binstub过时了?

如果这不起作用,只需删除project/bin目录即可终止binstub,然后重新运行bundle install -—binstubs

答案 1 :(得分:0)

你安装了多个版本的Rails,黄瓜不知道使用哪个版本,所以它试图加载这两个版本并错误输出。

要使用Gemfile中指定的那个,请在所有命令之前指定bundle exec,例如。 bundle exec cucumber