Error when trying to run rspec: `require': cannot load such file — rails_helper (LoadError)

后端 未结 13 731
青春惊慌失措
青春惊慌失措 2020-12-13 03:13

I am trying to run rspec for Ruby on Rails. I am running Rails 4.1.1. I have installed the gem, have established a spec folder with some tests. I have created a directory

相关标签:
13条回答
  • 2020-12-13 04:12

    None of these suggestions worked for me on Rails 4.2.0 with rspec-rails 3.2.3.

    Instead, I placed the following two lines at the top of my spec file:

    require 'rails_helper'
    require 'spec_helper'
    

    Now I can execute rspec spec/features/my_spec.rb.

    0 讨论(0)
提交回复
热议问题