环境/ cucumber.rb:黄瓜找不到安装宝石
...
# gem dependencies
config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' unless File.directory?(File.join(Rails.root, 'vend
config.gem 'database_cleaner', :lib => false, :version => '>=0.5.0' unless File.directory?(File.join(Rails.root, 'vend
config.gem 'webrat', :lib => false, :version => '>=0.7.0' unless File.directory?(File.join(Rails.root, 'vend
config.gem 'spork', :lib => false, :version => '>=0.7.5' unless File.directory?(File.join(Rails.root, 'vend
config.gem 'factory_girl', :source => 'http://gemcutter.org'
config.gem 'selenium-client', :lib => false
config.gem 'Selenium', :lib => false
config.gem 'rspec', :lib => 'spec'
config.gem 'rspec-rails', :lib => 'spec/rails'
config.gem 'test-unit', :lib => false
运行黄瓜给缺少宝石错误:
artem:~/projects/food4feed (master)$ cucumber
...
no such file to load -- Selenium
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rspec-rails-1.3.2/lib/spec/rails.rb:13:in `<top (required)>'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in `load'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/initializer.rb:307:in `block in load_gems'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/initializer.rb:307:in `each'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/initializer.rb:169:in `process'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
/home/artem/projects/food4feed/config/environment.rb:9:in `<top (required)>'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/projects/food4feed/features/support/env.rb:12:in `block in <top (required)>'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/spork-0.8.1/lib/spork.rb:23:in `prefork'
/home/artem/projects/food4feed/features/support/env.rb:10:in `<top (required)>'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/step_mother.rb:85:in `load_code_file'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/step_mother.rb:77:in `block in load_code_files'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/step_mother.rb:76:in `each'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/step_mother.rb:76:in `load_code_files'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/cli/main.rb:48:in `execute!'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/lib/cucumber/cli/main.rb:20:in `execute'
/home/artem/.rvm/gems/ruby-1.9.1-p378/gems/cucumber-0.6.3/bin/cucumber:8:in `<top (required)>'
/home/artem/.rvm/gems/ruby-1.9.1-p378/bin/cucumber:19:in `load'
/home/artem/.rvm/gems/ruby-1.9.1-p378/bin/cucumber:19:in `<main>'
Missing these required gems:
selenium-client
Selenium
rspec-rails
You're running:
ruby 1.9.1.378 at /home/artem/.rvm/rubies/ruby-1.9.1-p378/bin/ruby
rubygems 1.3.5 at /home/artem/.rvm/gems/ruby-1.9.1-p378, /home/artem/.rvm/gems/ruby-1.9.1-p378%global
所有的宝石都显得有:
artem:~/projects/food4feed (master)$ gem list | egrep "elenium|rspec|test-unit"
rspec (1.3.0)
rspec-rails (1.3.2)
Selenium (1.1.14)
selenium-client (1.2.18)
test-unit (2.0.7)
更令人困惑的是,它只是抱怨某些宝石。 factory_girl
和rspec
不会导致问题。
任何想法是怎么回事?
我的环境:
- 的Rails 2.3.5
- 黄瓜(0.6.3)
- 黄瓜导轨(0.3.0)
'test-unit'是上述其中一个gem的依赖项。它只适用于'rake gems:安装RAILS_ENV = cucumber'来安装它。 – artemave 2010-03-22 12:23:34
更正!更正!! 'test-unit'实际上不会引起问题,因为它是':lib => false'。我的错,我认为我首先复制了错误的堆栈跟踪(更正)。但是,这并没有改变这个问题。 – artemave 2010-03-22 12:32:37
你实际上指出了正确的方向。除了rspec-rails之外,它都是关于gem/library名称不匹配的。谢谢! – artemave 2010-03-22 16:48:26