开发者

Rails BDD with Cucumber: no such file to load -- cucumber-rails

I have project on Rails (2.3.5). I add into environment.rb same sting:

config.gem "cucumber-rails",

run "rake gems:unpack:dependencies". Output of "rake gems":

  • [F] cucumber-rails
    • [F] cucumber >= 0.6.2
      • [F] term-ansicolor >= 1.0.4
      • [F] treetop >= 1.4.2
        • [F] polyglot >= 0.3.1
      • [F] polyglot >= 0.2.9
      • [F] builder >= 2.1.2
      • [F] diff-lcs >= 1.1.2
      • [F] json_pure >= 1.2.0

When开发者_如何学Python I run "script/generate cucumber" I get Missing these required gems: cucumber-rails

Who can help me to fix this?


Try moving the config.gem statement from environment.rb to environments/test.rb

EDIT

Why does this work? I'm not sure, but my guess would be that the cucumber generator (script/generate cucumber) is expecting to run in the development environment, and not the test environment. When you declare config.gem in environment.rb, it applies to all environments. Maybe the generator gets confused when it finds cucumber-rails where it's not expected?

I'd go on, but my wrists are sore from all this hand-waving...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜