Rspec / Rails: uninitialized constant ActiveSupport :: Autoload (NameError)

I try to run bundle exec rspec , but I get the following error that occurs when I call spec_helper.rb

 template.rb:8:in `<class:Template>': uninitialized constant ActiveSupport::Autoload (NameError) 

Here is my spec_helper.rb file:

 require 'rubygems' require 'rspec/rails' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) RSpec.configure do |config| config.infer_spec_type_from_file_location! end 
+7
ruby-on-rails rspec
source share
1 answer

After switching the order of my Rspec file to the following, I no longer receive an uninitialized persistent error:

 require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'capybara/rspec' require 'capybara/poltergeist' Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new(app, {:js_errors=> false}) end RSpec.configure do |config| config.infer_spec_type_from_file_location! 
+3
source share

All Articles