Cucumber doesn't work but rake cucumber does

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 `'

But it seems like I have the right rails version in this directory.

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

I'm kind of new to ruby and am confused as to why "rake cucumber" works but "cucumber" doesn't in the terminal. I don't know how ruby and gems are set up but I have a hunch is that somehow in my working directory, ruby is told to use rails 3.2.14 but the command "cucumber" is only detecting activtesupport 4.0.0 (which I believe is tied to rails)

Thanks so much!


cucumber is a binstub, while rake cucumber is a rake task that executes the library.

Try bundle install -—binstubs first, then try cucumber .

Perhaps the binstub is somehow out of date?

If that doesn't work, just kill the binstubs by deleting the project/bin dir, and rerun bundle install -—binstubs


You have multiple versions of Rails installed and cucumber doesn't know which to use, so it's trying to load both and erroring out.

To use the one specified in your Gemfile, specify bundle exec before all commands, eg. bundle exec cucumber .

链接地址: http://www.djcxy.com/p/38766.html

上一篇: require.rb:55:在'require'中:无法加载这样的文件错误

下一篇: 黄瓜不起作用,但耙黄瓜呢