【问题标题】:Why cant i push to heroku? [duplicate]为什么我不能推送到heroku? [复制]
【发布时间】:2020-12-08 02:57:17
【问题描述】:
C:\Users\User\Desktop\AlveusBot>git push heroku master:main
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 1.12 KiB | 1.12 MiB/s, done.
Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 36a9c86df5cf527e2e8571da73210e6d36a4fe7e
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 36a9c86df5cf527e2e8571da73210e6d36a4fe7e
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 alveusesbot.
remote:
To https://git.heroku.com/alveusesbot.git
 ! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/alveusesbot.git'

我是 git 和 heroku 的新手,我不明白为什么会出现这个问题以及如何解决它。我在网上尝试了很多解决方案,但都没有奏效。任何帮助都会有很大帮助。

【问题讨论】:

标签: git heroku


【解决方案1】:

上面写着The same version of this code has already been built,这可能意味着你还没有更新代码。你需要做一个提交。

  1. 运行git status 以查看您已上演的内容。它应该有关于如何登台的说明。
  2. 然后运行带有描述的git commit -m "description"。它应该提交所有暂存文件。
  3. 最后,运行您正在执行的命令git push heroku master:main,将更改推送/更新到heroku。
    有关 git 的更多信息是here

【讨论】:

  • “app 与 buildpack 不兼容”错误远比警告重要。
  • 没注意到,我现在去看看。
  • 无法对主要问题发表评论,所以我会在这里进行。 @David_Can 你的代码是什么语言?不兼容我认为这意味着不受支持的语言。您的语言是受支持的类型之一(Node.js、Ruby、Python、Java、PHP、Go、Scala、Clojure)吗?或者您有配置文件和/或托管服务器?
  • @Aarav 我的应用是 python。我已经声明了构建包,但我不知道它还想要什么,其他错误也消失了。
  • @David_Can 你有requirments.txtsetup.py 文件吗?错误似乎在构建源部分。或者您可能必须 set 构建包。
猜你喜欢
  • 2015-07-09
  • 1970-01-01
  • 2023-02-06
  • 2012-09-03
  • 2017-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多