运行bundle exec黄瓜很好,但只是运行黄瓜不起作用

时间:2011-07-15 13:46:20

标签: ruby-on-rails-3 cucumber

我在Rails 3上使用安装了cucumber-rails的黄瓜1.0。我想使用自动测试,但似乎自动测试只用cucumber而不是bundle exec cucumber来调用黄瓜。 bundle exec cucumber对我来说很好,但当我只用cucumber运行时,我得到:

Using the default profile...
uninitialized constant Diff::ReadableDiffer (NameError)
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in `const_missing'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/test-unit-2.3.0/lib/test/unit/ui/console/testrunner.rb:336:in `<module:Console>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/test-unit-2.3.0/lib/test/unit/ui/console/testrunner.rb:17:in `<module:UI>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/test-unit-2.3.0/lib/test/unit/ui/console/testrunner.rb:16:in `<module:Unit>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/test-unit-2.3.0/lib/test/unit/ui/console/testrunner.rb:15:in `<module:Test>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/test-unit-2.3.0/lib/test/unit/ui/console/testrunner.rb:14:in `<top (required)>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/redgreen-1.2.2/lib/redgreen.rb:2:in `<top (required)>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
/Users/Mike/Projects/exlab/config/application.rb:7:in `<top (required)>'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
/Users/Mike/Projects/exlab/config/environment.rb:2:in `<top (required)>'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-rails-1.0.2/lib/cucumber/rails.rb:5:in `<top (required)>'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `require'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `rescue in require'
/Users/Mike/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/Users/Mike/Projects/exlab/features/support/env.rb:7:in `<top (required)>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/rb_support/rb_language.rb:143:in `load'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime/support_code.rb:176:in `load_file'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime/support_code.rb:78:in `block in load_files!'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime/support_code.rb:77:in `each'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime/support_code.rb:77:in `load_files!'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/runtime.rb:39:in `run!'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/lib/cucumber/cli/main.rb:20:in `execute'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/gems/cucumber-1.0.1/bin/cucumber:14:in `<top (required)>'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/bin/cucumber:19:in `load'
/Users/Mike/.rvm/gems/ruby-1.9.2-p180@rails3/bin/cucumber:19:in `<main>'

任何线索?

1 个答案:

答案 0 :(得分:0)

TestUnit being replaced by MiniTest in Ruby1.9可能存在问题。你可以解决它将它添加到你的Gemfile:

group :development do
  gem 'test-unit', '~> 2.0.0'
end