将sprockets-rails升级到3.0.0后,Rails.application.assets在Heroku上为零 [英] Rails.application.assets is Nil on Heroku after upgrade sprockets-rails to 3.0.0
问题描述
我在本地控制台检查这个命令 Rails.application.assets
但它在heroku控制台中返回 Nil
。
但是当我回滚使用sprocket-rails 2.3.3并在heroku中检查 Rails.application.assets
时控制台它返回值。
发生了什么事? 链轮导轨变化的结果3.查看问题 https://github.com / rails / sprockets-rails / issues / 237
您现在可以通过设置 config.assets.compile = true
在/config/environments/production.rb中
I check this command Rails.application.assets
in local console it work but in heroku console it return Nil
.
but when I rollback to use sprockets-rails 2.3.3 and check Rails.application.assets
in heroku console it return value.
what happened?
This was the result of a change in sprockets-rails 3. See the issue https://github.com/rails/sprockets-rails/issues/237
You can get around the issue for now by setting config.assets.compile = true
in /config/environments/production.rb
这篇关于将sprockets-rails升级到3.0.0后,Rails.application.assets在Heroku上为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!