【问题标题】:Test First ruby Rspec Error测试第一个 ruby​​ Rspec 错误
【发布时间】:2014-07-15 17:40:44
【问题描述】:
ruby 2.0.0p247
Rails 4.1.4
rspec 3.0.2

我正在尝试进行 Test First ruby​​ 练习,但在执行 rake 时收到错误消息。或 rspec。

这里是:

/Users/ching/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- spec_helper (LoadError)

然后是一些目录,最后是这个:

/Users/ching/.rbenv/versions/2.0.0-p247/bin/ruby -S rspec /Users/ching/testruby/00_hello/hello_spec.rb -I/Users/ching/testruby/00_hello -I/Users/ching/testruby/00_hello/solution -f documentation -r ./rspec_config failed

【问题讨论】:

  • 你有一个spec_helper.rb在正确的位置吗?

标签: ruby rspec rake


【解决方案1】:

Rspec 3.0 现在使用rails_helper 而不是spec_helper。将规范顶部的任何 require 'spec_helper' 行替换为 require 'rails_helper'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多