【发布时间】:2022-01-11 23:00:02
【问题描述】:
我第一次尝试通过 Heroku 部署 Django 应用程序。
当我运行git push heroku master 时,它会返回此错误:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: e6acd22b123b939729546f4f06f368a8855a4744
remote: !
remote: ! We have detected that you have triggered a build from source code with version e6acd22b123b939729546f4f06f368a8855a4744
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 vygrapp.
remote:
To https://git.heroku.com/vygrapp.git
! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/vygrapp.git'
在 SO 上遇到类似问题后,我相信我的文件结构已正确配置 - git 从与我的 Procfile 等相同的位置部署。我还有一个 requirements.txt 文件,我相信它告诉 Heroku 这是一个 python 应用程序 - 所以我可以'不知道为什么 buildpack 不工作。
根据 cmets 和反馈,我将所有文件夹移至根目录,但收到相同的错误。
【问题讨论】: