我有一个小型 Rails 4.0.0 / Ruby 2.0.0-p247 应用程序,我想为其编写一些测试。当我跑
rake cucumber:all
我收到以下错误:
/Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -S bundle exec cucumber --profile default
/Users/me/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/json/common.rb:155:in `parse': uninitialized constant JSON::Parser (NameError)
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/multi_json-1.7.8/lib/multi_json/adapters/json_common.rb:16:in `load'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/multi_json-1.7.8/lib/multi_json/adapter.rb:19:in `load'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/multi_json-1.7.8/lib/multi_json.rb:118:in `load'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:14:in `<class:I18n>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:6:in `<module:Gherkin>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:5:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin/lexer/i18n_lexer.rb:2:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin/lexer/i18n_lexer.rb:2:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin.rb:1:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/gherkin-2.12.0/lib/gherkin.rb:1:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/cucumber-1.3.5/lib/cucumber/cli/main.rb:2:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/cucumber-1.3.5/lib/cucumber/cli/main.rb:2:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/cucumber-1.3.5/bin/cucumber:11:in `require'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/cucumber-1.3.5/bin/cucumber:11:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/cucumber:23:in `load'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/cucumber:23:in `<main>'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
我运行了捆绑安装、捆绑更新、gem 清理等,但无济于事。这个相同的 Rails 应用程序在不同的机器(Mac OS X 10.8.4)上运行良好,但我的(Mac OS X 10.8.2)不工作。有任何想法吗?