Unhandled exception: cannot load such file - rails_helper

Here is the error when debugging (Aptana 3.6.1) the case of rspec (v3.4.1).

Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:54432 Uncaught exception: cannot load such file -- rails_helper C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require' C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require' C:/D/code/rails_proj/engines/simple_orderx/spec/controllers/simple_orderx/orders_controller_spec.rb:1:in `<top (required)>' C:/Ruby22-x64/bin/rdebug-ide:23:in `load' C:/Ruby22-x64/bin/rdebug-ide:23:in `<main>' 

The error is caused by a line in the spec file:

 require "rails_helper" 

If changed to require "spec_helper" , then the error will can not load spec_helper .

Line # 121 in kernel_require.rb is

 return gem_original_require(path) 

Here path returns the value "rails_helper". It does not seem to know where the root of the application is. Tried to use "spec / rails_helper" and the error is the same. But when running bundle exec rspec spec , there is no error in the root of the application. The rspec version is 3.4.1, rails 4.2 and ruby ​​2.2.3. IDE - Aptana 3.6.1.

+7
source share

All Articles