Ruby on rails Heroku css未在资源之后加载:预编译
Heroku突然停止工作,给了我这个错误:Ruby on rails Heroku css未在资源之后加载:预编译,ruby-on-rails,heroku,ruby-on-rails-4,Ruby On Rails,Heroku,Ruby On Rails 4,Heroku突然停止工作,给了我这个错误: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting Precompiling assets failed. 经过一些研究后,我运行了以下行: running RAILS_ENV=production bundle exec rake assets:precompile 这是可行的,
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
Precompiling assets failed.
经过一些研究后,我运行了以下行:
running RAILS_ENV=production bundle exec rake assets:precompile
这是可行的,但现在当我向heroku推送更新时,新的css不会加载。
这行以前从未显示过:
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
如果可能,您还可以解释为什么assets:precompile行解决了我的原始问题吗?运行以下命令:
bundle exec rake tmp:clear
bundle exec rake assets:clean RAILS_ENV=production
bundle exec rake assets:precompile RAILS_ENV=production
希望这有帮助 阅读:这将回答您的问题,为什么您应该预编译您的资产。但该特定命令使用
exec
命令在生产模式下运行它。另外,当你说新的CSS不会更新你得到的控制台中的错误时。发这篇文章谢谢你的链接,这让我更了解它。推到heroku时没有错误,只是没有加载任何新的css。此时,当您尝试加载页面时,请打开firebug或chrome开发工具并转到控制台。你应该有一些outputHmm,chrome开发者控制台只是显示一些关于字体的信息。谢谢你的帮助!