Heroku推送:我们必须提交runtime.txt



runtime.txt应该在部署到Heroku之前进行git提交吗?

我目前有一个runtime.txt已正确填充(python-3.8.6(,但当我运行git push heroku master:时,它似乎被忽略了

$ git push heroku master -v
Pushing to https://git.heroku.com/my-app-xxxx.git
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 890 bytes | 890.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0)
POST git-receive-pack (1059 bytes)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote:  !     Requested runtime (python-3.7.5) is not available for this stack (heroku-20).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 2bb6cb469f45a6165948a97c6ef8exxxxx
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 2bb6cb469f45a6165948a97c6ef8exxxxx
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
[...]

尽管:

$ cat runtime.txt 
python-3.8.6

供参考:

$ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
.vscode/
__pycache__/my-app-xxxx.cpython-38.pyc
runtime.txt

响应:是的,runtime.txt显然不是在Heroku CLI级别处理的,而是在服务器端处理的,因此必须将其考虑在内。

最新更新