views:

1218

answers:

5

I had cucumber 0.6.1 working quite fine... but I ran the gem update cucumber command, and things went smoothly. Then when I decided to run the cucumber features command, I received this error:

Using the default profile... no such file to load -- cucumber/webrat/element_locator (MissingSourceFile) /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inpolyglot_original_require'

So I tried a few things... I did a gem update on webrat, that didn't work. I removed all previous versions of cucumber by doing gem uninstall cucumber then selecting past versions. Same with webrat. No luck. What am I doing wrong?

+1  A: 

Have you tried to regenerate cucumber files with script/generate cucumber --webrat? Maybe it solves it. Just take care not to overwrite features/support/paths.rb.

Thorbjørn Hermansen
A: 

I am having this same problem. The above solution hasn't worked for me. Im trying to get Culerity running on my machine with JRuby.

Im still getting:

    no such file to load -- cucumber/webrat/element_locator (MissingSourceFile)
/opt/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/opt/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/opt/jruby/lib/ruby/gems/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/opt/jruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
/Users/Peter/Sites/kit/features/support/env.rb:38
/Users/Peter/Sites/kit/features/support/env.rb:31:in `require'
/opt/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/opt/jruby/lib/ruby/gems/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:84:in `load_code_file'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:76:in `load_code_files'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `each'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `load_code_files'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/cucumber:8
/opt/jruby/lib/ruby/gems/1.8/gems/cucumber-0.6.2/bin/cucumber:19:in `load'
/opt/jruby/bin/cucumber:19
zoltarSpeaks
A: 

I resolved this issue. There was an old version of the 'freelancing-god-thinking-sphinx' gem on the server i was deploying to. Removing this gem enabled everything to work properly.

zoltarSpeaks
A: 

I had a similar issue using Bundler where my Gemfile had >= 0.4.3 version of cucumber, so it would always look to install newer versions of cucumber when updating/installing the bundler gems. Cucumber's env file (/features/support/env), however, referenced files that were not part of the future releases. In particular, '/cucumber/rails/world'. Therefore, I got the same MissingSourceFile error you are getting.

I think either want to roll back your version of cucumber, or update your cucumber env file so it's compatible with your version of cucumber.

Matt Dressel
A: 

For me, I commented out the following line in my env.rb file

 # require 'cucumber/webrat/element_locator' 
 # Deprecated in favor of #tableish - remove this line if you don't 
 # use #element_at or #table_at

As you can see by the comment following it, it has been depreciated anyway.

y0mbo