简体   繁体   English

Heroku在git push上部署“预编译资产失败”

[英]Heroku deploy “Precompiling assets failed” on git push

We used the Heroku fork command to clone our production Rails 3 application for some testing. 我们使用Heroku fork命令来克隆生产的Rails 3应用程序以进行一些测试。 This was successful. 这是成功的。

We are now attempting to push changes to the new forked app via a standard heroku git push deploy. 我们现在正尝试通过标准的heroku git push部署将更改推送到新的分支应用程序。

We are getting "Precompiling assets failed." 我们得到“预编译资产失败”。 and "Push rejected, failed to compile Ruby app" errors on each attempt. 以及每次尝试均出现“推送被拒绝,无法编译Ruby应用”错误。

This exact repo is used for updates to our production application with no problems. 此确切的存储库可毫无问题地用于更新我们的生产应用程序。

Can you direct me to how we might troubleshoot this? 您能指导我如何解决此问题吗?

try this in your config/application.rb 在您的config / application.rb中尝试一下

config.assets.initialize_on_precompile = false config.assets.initialize_on_precompile =假

Also, check if you included gem 'turbolinks' in your Gemfile. 另外,请检查您的Gemfile中是否包含gem'turbolinks'。 In my case I had failed to deploy the app multiple times (even after modifying my application.rb file via adding 'initialize_on_precompile') until I changed my Gemfile and installed missing gem. 以我为例,我多次部署该应用程序都失败了(即使在通过添加'initialize_on_precompile'修改了application.rb文件之后),直到更改了Gemfile并安装了丢失的gem。

Also, if you did not see before, there is some useful info concerning forking and deploying on Heroku (section "Deploy"): https://devcenter.heroku.com/articles/fork-app 另外,如果您以前没有看过,那么还有一些有关在Heroku上进行分叉和部署的有用信息(“部署”部分): https : //devcenter.heroku.com/articles/fork-app

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM