【问题标题】:`require': cannot load such file -- rails/all (LoadError)`require': 无法加载此类文件 -- rails/all (LoadError)
【发布时间】:2014-06-11 05:57:21
【问题描述】:

在为插件运行 rspec 时出现以下错误。

无法加载此类文件 -- rails/all (LoadError)

需要在 application.rb 中定义“rails/all”

谁能帮我解决上述问题?

【问题讨论】:

  • 如何运行命令?你用捆绑包吗?
  • 规范是 Rails 应用还是 gem?
  • 嗨 Geoffroy,我使用了 rspec spec 命令。
  • Hi Rich,插件规范
  • 所以您在终端中输入的实际命令是... rspec or rake spec or rspec spec ?

标签: ruby-on-rails rspec ruby-on-rails-plugins


【解决方案1】:

听起来像rspec找不到rails gem,这通常意味着gem没有全局安装。尝试使用:

bundle exec rspec spec

这会将所有 Gemfile 的 gem 加载到 rspec 的环境中以允许加载它们。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-27
    • 2017-03-27
    • 1970-01-01
    • 1970-01-01
    • 2022-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多