简体   繁体   English

从Git推送到Heroku无效

[英]Push from Git to Heroku not working

I recently updating a website where many gems had deprecated (I was using a heroku gem, for example). 我最近在一个不推荐使用许多宝石的网站上进行了更新(例如,我正在使用heroku宝石)。 I'm at the final step of updating my localfiles to the production server. 我处于将本地文件更新到生产服务器的最后一步。

When I run 'git push heroku master' I get this error: 当我运行'git push heroku master'时,出现此错误:

 Failed to install gems via Bundler
 Push rejected, failed to compile Ruby app.
 Push failed
 ...
 ! [remote rejected] master -> master (pre-receive hook declined)

Any advice is welcome. 欢迎任何建议。 Once again - I had to update Ruby/Rails/Heroku, so I'm sure there could be some odd compatibility issue that I'm not seeing. 再次-我必须更新Ruby / Rails / Heroku,所以我确定可能会出现一些我没有看到的奇怪兼容性问题。 However I've got it all to work locally, and would expect it to work on Heroku. 但是,我已经将其全部用于本地工作,并且希望它能在Heroku上工作。

It turns out, when you update from rails 3~ to rails 5, there is this thing called 12factor that you have to add to your production.rb. 事实证明,当您从导轨3〜更新到导轨5时,您必须在production.rb中添加一个称为12factor的东西。

https://github.com/heroku/rails_12factor https://github.com/heroku/rails_12factor

This solved my problem, and I was able to push. 这解决了我的问题,并且我能够推动。 The next error that I ran into was H10. 我遇到的下一个错误是H10。 This is because you have to run: 这是因为您必须运行:

     rake app:update:bin

To rebuild the bin (?). 重建垃圾箱(?)。 Then push it, and deploy. 然后推动它并部署。 Website is back up and running! 网站已备份并正在运行! I hope this helps someone in the future. 我希望这对以后的人有所帮助。

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

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