推送到Heroku时,Rails App预编译资产失败错误

时间:2018-08-11 18:50:57

标签: ruby-on-rails heroku

在将其标记为重复之前-我已经看到其他线程具有相同的问题,并且解决方案始终包括     “ config.assets.initialize_on_precompile =假” 到我的config / application.rb配置文件,我已经完成了,但是错误仍然存​​在。这是我的application.rb文件:

require_relative 'boot'

require 'rails/all'

Bundler.require(*Rails.groups)

module SampleApp
   class Application < Rails::Application

   config.load_defaults 5.2

   config.assets.initialize_on_precompile = false

  end
end

这是我运行$ git push heroku master时的完整错误消息:

remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected

1 个答案:

答案 0 :(得分:0)

尝试<script> function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo").innerHTML = this.responseText; } }; xhttp.open("GET", "articles.xml", true); xhttp.send(); </script> 希望这能解决您的问题!