简体   繁体   English

预编译时Rails生产bootstrap-sass错误

[英]Rails production bootstrap-sass error on precompile

Everything is working great with my rails app in development environment. 我的Rails应用程序在开发环境中一切正常。 But when I try it in production mode I get this error when I'm doing some precompile : 但是当我在生产模式下尝试它时,在执行一些预编译时会出现此错误:

RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
NoMethodError: undefined method `<<' for true:TrueClass
/home/xxxxx/.rvm/gems/ruby-2.1.5/gems/bootstrap-sass-3.3.4.1/lib/bootstrap-sass/engine.rb:8:in `block in <class:Engine>'
/home/xxxxx/.rvm/gems/ruby-2.1.5/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `instance_exec'
/home/xxxxx/.rvm/gems/ruby-2.1.5/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `run'
/home/xxxxx/.rvm/gems/ruby-2.1.5/gems/railties-4.1.6/lib/rails/initializable.rb:55:in `block in run_initializers'

I already tried multiples solutions found but none works so far. 我已经尝试过找到多种解决方案,但到目前为止没有一种有效。

I tried to add config.assets.initialize_on_precompile = false into config/application.rb without success... 我试图将config.assets.initialize_on_precompile = false添加到config/application.rb但没有成功...

As @infused pointed out, there was a config.assets.precompile = true somewhere in my code that was create this error. 正如@infused指出的那样,在我的代码中某处有一个config.assets.precompile = true导致此错误。 Removing it resolved this issue ! 删除它解决了这个问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM