开发者

MissingSourceFile when I run "cucumber features"

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.开发者_Go百科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?


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜