Ive developed several apps on heroku before and never ran into this error:
我之前在heroku上开发了几个应用程序,但从未遇到过这个错误:
ActionView::Template::Error (application.css isn't precompiled):
ActionView :: Template :: Error(application.css未预编译):
My latest push didn't even have a change to the application.css
file.. Whats going on here?
我的最新推文甚至没有对application.css文件进行更改..这里发生了什么?
Ive seen articles saying change a line in production.rb
to:
我看过有些文章说将production.rb中的一行更改为:
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
But wont that slow everything down? Why is this error suddenly happening? Whats the best way to fix it?
但是,这会减慢一切吗?为什么突然发生这个错误?什么是最好的解决方法?
Edit: I should note its working in development just fine.
编辑:我应该注意它在开发中工作得很好。
1 个解决方案
#1
15
Run rake assets:precompile:all
in your development environment. Ensure that it does not give you an error and that it creates public/assets/application.css
. If it does give you an error, resolving it should resolve the problem on Heroku.
在您的开发环境中运行rake assets:precompile:all。确保它不会给您一个错误,并且它会创建public / assets / application.css。如果它确实给你一个错误,解决它应该解决Heroku上的问题。
#1
15
Run rake assets:precompile:all
in your development environment. Ensure that it does not give you an error and that it creates public/assets/application.css
. If it does give you an error, resolving it should resolve the problem on Heroku.
在您的开发环境中运行rake assets:precompile:all。确保它不会给您一个错误,并且它会创建public / assets / application.css。如果它确实给你一个错误,解决它应该解决Heroku上的问题。