kernel_require.rb:55:in `require': cannot load such file error

后端 未结 3 1346
刺人心
刺人心 2021-01-17 14:24

I\'m using Ruby version 1.9.3 at the moment (although I get the same issue with Ruby 2.0.0). On Windows 7 64-bit. I\'m following \'The Cucumber Book\' and got stuck at the

相关标签:
3条回答
  • 2021-01-17 14:33

    Whenever you install a new gem you need to update the bundle (as @zwolfe pointed out). Hence, run:

    bundle update

    Right after you should be able to run your Ruby scripts either using simply:

    ruby <yourRubyScript.rb> or bundle exec ruby <yourRubyScript.rb

    0 讨论(0)
  • 2021-01-17 14:40

    I just encountered the same issue, and I believe it's a problem with bundler. In any case, I solved the problem by running:

    bundle update
    bundle exec ruby <yourfilename.rb>
    

    Hope this helps!

    0 讨论(0)
  • 2021-01-17 14:51

    It seems I encountered the same issue before. I fixed it by adding a simple

    require rubygems
    

    before all my require line code.

    0 讨论(0)
提交回复
热议问题