gpt4 book ai didi

cucumber 无法加载这样的文件——rails (LoadError)

转载 作者:行者123 更新时间:2023-12-05 01:15:44 26 4
gpt4 key购买 nike

我已经按照 https://github.com/cucumber/cucumber-rails#installation 在新的 Rails 4 应用程序中安装了 Cucumber-rails gem

但是当我尝试运行它时会发生错误:

biske@biske:~/bla$ cucumber

cannot load such file -- rails (LoadError)
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 'require'
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 'rescue in require'
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:35:in 'require'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.1/lib/cucumber/rails.rb:3:in '<top (required)'
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 'require'
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 'rescue in require'
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:35:in 'require' /home/biske/bla/features/support/env.rb:7:in '<top (required)'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/rb_support/rb_language.rb:122:in 'load'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/rb_support/rb_language.rb:122:in 'load_code_file'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime/support_code.rb:180:in'load_file'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime/support_code.rb:83:in 'block in load_files!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime/support_code.rb:82:in 'each'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime/support_code.rb:82:in 'load_files!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime.rb:183:in 'load_step_definitions'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/runtime.rb:42:in 'run!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/lib/cucumber/cli/main.rb:47:in 'execute!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.3.4/bin/cucumber:13:in '<top (required)' /usr/bin/cucumber:23:in 'load' /usr/bin/cucumber:23:in '<main'

此错误提示 features/support/env.rb 文件中的第 7 行,即:
require 'cucumber/rails'

这里可能有什么问题?

最佳答案

在将 Cucumber-rails 版本升级到 1.3.15 后,我遇到了这个问题。

首先重新生成你的 cucumber 配置(特别是如果你最近更新了一些 gem):

rails g cucumber:install

如果它没有帮助尝试使用命令在捆绑器中运行 cucumber :
bundle exec cucumber

或更方便且技术上相同的命令(在我的情况下适用于 rails 4.1.1):
rake cucumber

了解有关“bundle exec”命令前缀的更多信息: Use bundle exec rake or just rake?

关于 cucumber 无法加载这样的文件——rails (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17901076/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com