簡體   English   中英

git push heroku master 被拒絕並且無法編譯 ruby​​ 應用程序

[英]git push heroku master is rejected and faild to compile ruby app

做了一些研究,但是當我嘗試git push heroku master.時無法弄清楚是什么導致了拒絕git push heroku master.

這是我的 git repo: https : //github.com/leonahu/IMGfeed ,這是拒絕的詳細信息:

remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
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 to feedimg.
remote: 

該錯誤表示資產無法預編譯,因此您應該通過運行bundle exec rake assets:precompile來預編譯它們

或者專門用於生產運行RAILS_ENV=production bundle exec rake assets:precompile

確保你的config/application.rb文件中有這行代碼: config.assets.initialize_on_precompile = false

在此之后,嘗試再次推送到 heroku

我想你可能忘記在生產中設置config.secret_key_base 跑:

heroku config:set SECRET_KEY_BASE=your_secret_key_base

要獲得新的密鑰,您可以在項目的根文件夾中運行bundle exec rake secret

我嘗試了上面的所有建議,但它在我的應用程序上不起作用(感謝所有試圖提供幫助的人。)最終對我有用的是我基本上通過運行強制 Heroku:

git push heroku master --force

在那之后,我能夠再次git push heroku master

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM