`require': No such file to load — test_helper (LoadError)

牧云@^-^@ 提交于 2019-12-05 07:45:11

You have a test, quarterly_export_statement_test.rb, in your app/controllers directory.

In production, Rails loads all classes eagerly, so it attempts to load your test. Your test does require 'test_helper'. The test directory, which contains test_helper, isn't in the load path in the production environment (good!), so that require fails.

To fix the problem, move the test to the test directory where it belongs, which appears to be /home/nyros/Documents/Projects/DFL/Working/DFL/test.

Skull0inc

I got the same error while using: railstutorial.org Chapter 6. The offending file for me was app/helpers/application_helper_test.rb which had require 'test_helper' at the top.

I commented that line out, did

git add -A
git push
git push heroku

Then ran heroku run console, which worked :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!