Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Heroku css未在资源之后加载:预编译_Ruby On Rails_Heroku_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails Heroku css未在资源之后加载:预编译

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 这是可行的,

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
如果可能,您还可以解释为什么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开发者控制台只是显示一些关于字体的信息。谢谢你的帮助!