Rspec/Rails: uninitialized constant ActiveSupport::Autoload (NameError)
I am trying to run bundle exec rspec
but am getting the following error that is being thrown in my call to 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
在将我的Rspec文件的顺序切换到以下之后,我不再收到未初始化的常量错误:
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!
链接地址: http://www.djcxy.com/p/21910.html
上一篇: Amazon SNS Apple推送通知教程中的错误(空指针异常)
下一篇: Rspec / Rails:未初始化的常量ActiveSupport :: Autoload(NameError)