简体   繁体   English

无法将 git 回购推送到 Heroku

[英]Cannot push git repo to Heroku

I try to push my git repo to Heroku, but I get error:我尝试将我的 git 存储库推送到 Heroku,但出现错误:


remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Detecting rake tasks
remote: 
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     /tmp/build_641166cf/bin/rake:8:in `require': cannot load such file -- rake (LoadError)
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 93a5bb6ab6e77c479f857031010316f9f372e20f
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 93a5bb6ab6e77c479f857031010316f9f372e20f
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to whispering-fortress-58873.
remote: 
To https://git.heroku.com/whispering-fortress-58873.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: не удалось отправить некоторые ссылки в «https://git.heroku.com/whispering-fortress-58873.git»

How to fix it?如何解决? I've been trying to fix this for two days now.这两天我一直在努力解决这个问题。

  • Ruby version: 2.7.2 Ruby版本:2.7.2
  • Rails version: 5.2.4.4导轨版本:5.2.4.4
  • Gem version: 3.1.4宝石版本:3.1.4
  • Bundler version: 2.2.7捆绑器版本:2.2.7

Checking error logs it seems that you need to push your branch to main检查错误日志,您似乎需要将分支推送到main

Try the following (or replace master with your current branch)尝试以下操作(或将master替换为您当前的分支)

git push heroku master:main

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

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