簡體   English   中英

無法將 git 回購推送到 Heroku

[英]Cannot push git repo to Heroku

我嘗試將我的 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»

如何解決? 這兩天我一直在努力解決這個問題。

  • Ruby版本:2.7.2
  • 導軌版本:5.2.4.4
  • 寶石版本:3.1.4
  • 捆綁器版本:2.2.7

檢查錯誤日志,您似乎需要將分支推送到main

嘗試以下操作(或將master替換為您當前的分支)

git push heroku master:main

暫無
暫無

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

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