无法运行guard-test:`require':无法加载此类文件 - test_helper(LoadError)

时间:2018-01-05 01:10:54

标签: ruby-on-rails

我安装了guard-test但它不会运行。

>bundle exec guard
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
19:54:44 - INFO - Run 'gem install win32console' to use color on Windows
19:54:45 - INFO - Guard::Test 2.0.8 is running, with Test::Unit 3.2.7!
19:54:45 - INFO - Running all tests
test/controllers/brokers_controller_test.rb:1:in `require': cannot load such file -- test_helper (LoadError)
        from test/controllers/brokers_controller_test.rb:1:in `<top (required)>'
        from -e:1:in `load'
        from -e:1:in `block in <main>'
        from -e:1:in `each'
        from -e:1:in `<main>'
[1] guard(main)>  Guard is now watching at ...

这是测试的第一行:

>head -1 test/controllers/brokers_controller_test.rb
require 'test_helper'

Rails测试工作正常:

>rails test test/controllers/brokers_controller_test.rb
Run options: --seed 56448

# Running:

.......

Finished in 41.778710s, 0.1675 runs/s, 0.2394 assertions/s.

7 runs, 10 assertions, 0 failures, 0 errors, 0 skips

我的Guardfileguard init test的默认设置。

Rails 5.0.2,Windows

0 个答案:

没有答案