views:

486

answers:

4

When running rspec I get the following error:

no such file to load -- cucumber-rails
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:169:in `process'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
/home/amurmann/NetBeansProjects/demandserver/config/environment.rb:10
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
./spec/helpers/../spec_helper.rb:6
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
./spec/helpers/profiles_helper_spec.rb:1
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load_files'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `each'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `load_files'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in `run_examples'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run'
/usr/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec:5
/usr/bin/spec:19:in `load'
/usr/bin/spec:19
Missing these required gems:
  cucumber-rails  

You're running:
  ruby 1.8.7.174 at /usr/bin/ruby1.8
  rubygems 1.3.5 at /home/amurmann/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.

I set up the test environemnt to require rspec, rspec-rails as well as cucumber. These are all installed:

 - [F] has_many_polymorphs 
    - [R] activerecord 
 - [I] rspec >= 1.2.0
 - [I] rspec-rails >= 1.2.0
    - [I] rspec >= 1.3.0
    - [R] rack >= 1.0.0
 - [I] factory_girl 
 - [I] webrat >= 0.4.3
    - [I] nokogiri >= 1.2.0
    - [R] rack >= 1.0
    - [I] rack-test >= 0.5.3
       - [R] rack >= 1.0
 - [I] cucumber-rails 
    - [I] cucumber >= 0.6.2
       - [I] term-ansicolor >= 1.0.4
       - [I] treetop >= 1.4.2
          - [I] polyglot >= 0.2.5
       - [I] polyglot >= 0.2.9
       - [R] builder >= 2.1.2
       - [I] diff-lcs >= 1.1.2
       - [I] json_pure >= 1.2.0
 - [I] database_cleaner >= 0.4.3

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

I already reinstalled both cucumber and rspec, but the error persists.

Thank you very much for any help!

A: 

hmm, you did use sudo gem install cucumber-rails to install the gem right? Sometimes that throws 'stuff' off.

pjammer
No, I installed it via rake gems:install RAILS_ENV=testAfter running RSpec kept complaining, I checked and saw that two versions of RSpec were installed. So I uninstalled both, as well as Cucumber and reinstalled both again via the rake gems:install RAILS_ENV=test. However it keeps complaining. Cucumber on the other hand ran fine and still runs fine.
ajmurmann
A: 

I am having the same problem on windows:xp. Running slightly newer gems, but most of the environment is same as the original post.

kaushik katari
OK, this is what I did. 1> Try uncommenting config.gem cucumber2> If you have config.gem cucumber, use :lib => false
kaushik katari
+1  A: 

OK, I figured it out myself:

The spec file I was running had a "require 'cucumber_rails'". I don't know if and why I put that there or if it was put there by some script. I removed this and now everything works.

I am not sure why this caused a problem, but now it works. If someone knows why this causes trouble, I would be happy about an explanation.

ajmurmann
A: 

Guys, just follow the Wiki instructions.