使用Test First Ruby的终端错误

时间:2014-09-10 12:22:39

标签: ruby rspec terminal test-first

我刚刚开始测试First Ruby&我在耙子开始解决问题时遇到了麻烦。

我认为这是我的RSpec版本或我的Ruby版本导致错误。

这是错误,

AT MacBook-Pro:01_temperature AT$ rake
(in /Users/AT/Desktop/learn_ruby)
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- temperature (LoadError)
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/AT/Desktop/learn_ruby/01_temperature/temperature_spec.rb:18:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `load'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:96:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:84:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:69:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:37:in `invoke'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/exe/rspec:4:in `<top (required)>'
    from /usr/bin/rspec:23:in `load'
    from /usr/bin/rspec:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S rspec /Users/AT/Desktop/learn_ruby/01_temperature/temperature_spec.rb -I/Users/AT/Desktop/learn_ruby/01_temperature -I/Users/AT/Desktop/learn_ruby/01_temperature/solution -f documentation -r ./rspec_config failed

几分钟前我遇到了类似的问题,但通过卸载RSpec v-3并安装v-2.14来修复。

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

您的文件temperature_spec需要我认为是被测试类的源temperature - 但RSpec加载程序无法解析此文件的路径。

发布rspec文件的来源和正在测试的课程会很有帮助。