Exception message: no such file to load in rails application

柔情痞子 提交于 2019-12-05 22:31:18

test_helper.rb is located within the test directory. You are running the tests from the root directory, which means the path to the file is wrong. Try running your tests from the test directory.

If you want to run your tests from the root directory, you would have to change this to require File.join(File.dirname(__FILE__), '..', 'test_helper.rb'), where FILE is the path to the file that contains this line (your test case), and the rest is the path of test_helper.rb, relative to that file. This way, where you run the test from is irrelevant.

In my situation (RM 7.1 / Win7 / Rails 3.0), I had to do the following:

Add "-Itest" at the beginning of "Ruby arguments"

Note: Changing the working directory to 'test' didn't work for me.
Source: https://devnet.jetbrains.com/message/5490675#5490675

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