为什么我得到! [remote rejected] master -> master (pre-receive hook declined) in dokku

why I get ! [remote rejected] master -> master (pre-receive hook declined) in dokku

我需要帮助。 我正在尝试将我的 Python/Flask 应用程序部署到 Dokku 服务器,但出现错误并且我不知道如何修复它。 这是 git 遥控器:

dokku   dokku@apps.danieldiaz.me:portfolio (fetch)
dokku   dokku@apps.danieldiaz.me:portfolio (push)

该应用程序是在服务器上创建的,但是当我创建一个:

git push dokku

或:

git push dokku master

我收到这个错误:

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 292 bytes | 292.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Cleaning up...
-----> Building portfolio from herokuish
-----> Adding BUILD_ENV to build environment...
-----> Unable to select a buildpack
remote: 2021/01/28 22:49:58 exit status 1
remote: 2021/01/28 23:49:58 exit status 1
To apps.danieldiaz.me:portfolio
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@apps.danieldiaz.me:portfolio'

apps.danieldiaz.me 有效,我可以通过 ssh 连接。

无法检测到您的 python 依赖项,因此 Dokku 无法 select python buildpack。你需要有一个 requirements.txt 表示你在你的 repo 根目录中的依赖关系来解决这个问题。