【问题标题】:Ruby "no such file to load" error running spec from rake task从 rake 任务运行规范的 Ruby“没有要加载的文件”错误
【发布时间】:2012-01-24 18:39:22
【问题描述】:

我已经使用 rspec 编写了测试。当我通过运行运行默认 rake 任务时

bundle exec rake spec

它给出了以下错误,尽管以前它可以正常工作。

`require': no such file to load -- sinatra/base (LoadError)

但如果我使用简单的方式运行测试

ruby spec/humongous_spec.rb

它运行得很好。我不知道这有什么问题。

【问题讨论】:

  • 如果你尝试运行rspec spec/会怎样?适用于 RSpec 2+

标签: ruby rspec sinatra specifications


【解决方案1】:

将此行添加到您的 Rakefile 中

require 'bundler/setup'
Bundler.require

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-06-09
    • 2013-03-04
    • 1970-01-01
    • 2012-11-25
    • 1970-01-01
    • 2011-07-25
    • 2011-02-15
    • 1970-01-01
    相关资源
    最近更新 更多