rails:每当我尝试运行我的规范时,获取未初始化的常量ActiveSupport :: Logger :: SimpleFormatter

时间:2015-06-02 15:41:23

标签: ruby-on-rails rspec activesupport railtie

我同时使用rake specrspec spec/尝试运行我的rspec测试,但是我收到以下错误:

/home/XXX/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/application/configuration.rb:49:in `initialize': uninitialized constant ActiveSupport::Logger::SimpleFormatter (NameError)
  from /home/XXX/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/application.rb:364:in `new'
  from /home/XXX/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/application.rb:364:in `config'
  from /home/XXX/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/railtie.rb:123:in `config'
  from /home/XXX/proj/candiru/config/application.rb:26:in `<class:Application>'
  from /home/XXX/proj/candiru/config/application.rb:11:in `<module:Candiru>'

这很奇怪,因为当我启动rails服务器和rails控制台时,这个文件(config/application.rb)被加载,没有任何问题。

“可疑”行是:config.assets.paths << Rails.root.join("vendor","assets","bower_components"),如果我将其注释掉,则下一个类似的配置行将标记为错误行。

你有没有猜到为什么会抛出这个错误?

0 个答案:

没有答案