Heroku css在资产之后没有加载:预编译

时间:2013-10-30 23:34:23

标签: 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

这有效但现在当我将更新推送到heroku时,新的css不会加载。 此行以前从未用过:

Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment

如果可能,您还可以解释为什么资产:预编译行解决了我原来的问题吗?

1 个答案:

答案 0 :(得分:10)

运行以下命令:

 bundle exec rake tmp:clear

 bundle exec rake assets:clean RAILS_ENV=production

 bundle exec rake assets:precompile RAILS_ENV=production

希望这有帮助!