Heroku css在资产之后不加载:预编译 [英] Heroku css not loading after assets:precompile

查看:123
本文介绍了Heroku css在资产之后不加载:预编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Heroku突然停止工作,并给了我这个错误:

 无法连接到服务器:连接被拒绝
Is在主机127.0.0.1上运行的服务器和接受
预编译资产失败。

经过一番研究,我跑了这条线:

 运行RAILS_ENV =生产捆绑包exec rake资产:预编译

这工作,但现在当我推动更新到heroku新的CSS不加载。
此行以前从未显示过:

 运行:捆绑安装 - 无需开发:测试 - 路径供应商/ bundle --binstubs vendor / bundle / bin --deployment 

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

解决方案

运行此命令:

  bundle exec rake tmp:clear 

undle bundle rake assets:clean RAILS_ENV = production

undle bundle rake assets:precompile RAILS_ENV =生产

希望这有助于您!


Heroku suddenly stopped working and gave me this error:

  could not connect to server: Connection refused
  Is the server running on host "127.0.0.1" and accepting
  Precompiling assets failed.

After some research I ran this line:

 running RAILS_ENV=production bundle exec rake assets:precompile

This worked but now when i push an update to heroku the new css doesn't load. This line never used to show before:

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

If possible can you also explain why the assets:precompile line solved my original problem?

解决方案

Run this commands:

 bundle exec rake tmp:clear

 bundle exec rake assets:clean RAILS_ENV=production

 bundle exec rake assets:precompile RAILS_ENV=production

Hope this helps!

这篇关于Heroku css在资产之后不加载:预编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆