加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Heroku css在资产之后没有加载:预编译

发布时间:2020-12-17 03:55:39 所属栏目:百科 来源:网络整理
导读: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 r
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

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

解决方法

运行以下命令:

bundle exec rake tmp:clear

 bundle exec rake assets:clean RAILS_ENV=production

 bundle exec rake assets:precompile RAILS_ENV=production

希望这可以帮助!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读