heroku错误bash:gunicorn:找不到命令

时间:2018-07-11 00:25:41

标签: heroku

几个月前,我将我的Flask应用推送到了Heroku https://shakespeare-tweet.herokuapp.com/(实时) 这是本地主机的屏幕截图:https://berkeley.app.box.com/file/303628505050 但是我试图对其进行更新,但它一直在中断:

这里是stackoverflow解决方案:Heroku + gunicorn not working (bash: gunicorn: command not found )

但是当我将其更新到新版本时,它给了我错误 Heroku + gunicorn不起作用(bash:gunicorn:找不到命令)

web:gunicorn myapp:app --log-file =- 但是该应用在部署时崩溃:

bash:gunicorn:找不到命令 我尝试添加heroku python buildpack,但是没有运气。如果我回滚到上一个提交(requests.txt和Procile都不变)。

我仍然收到相同的错误日志:

2018-07-10T21:52:11.855058+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shakespeare-tweet-pr-16.herokuapp.com request_id=068bae51-052e-4bf4-9b25-336c9a036709 fwd="165.124.160.252" dyno= connect= service= status=503 bytes= protocol=https
2018-07-10T21:52:31.144603+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-10T21:52:34.984576+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2018-07-10T21:52:36.771041+00:00 heroku[web.1]: Process exited with status 127
2018-07-10T21:52:36.714985+00:00 app[web.1]: bash: gunicorn: command not found
2018-07-10T21:52:36.787124+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-10T21:52:36.789041+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-10T21:52:40.971471+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2018-07-10T21:52:42.677787+00:00 heroku[web.1]: Process exited with status 127
2018-07-10T21:52:42.692987+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-10T21:52:42.618587+00:00 app[web.1]: bash: gunicorn: command not found
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
Connection to log stream failed. Please try again later.

I would appreciate any help with this issue.

1 个答案:

答案 0 :(得分:0)

好的,这里的问题是,shakespeare-tweet-pr-16应用程序是使用pipenv构建的,因此它将从Pipfile中获取依赖项,而不是从requirements.txt中获取依赖项。 Pipfile仅将flask列为依赖项,因此尚未安装Gunicorn,这就是为什么找不到它的原因。我建议您从应用程序中删除Pipfile。另一个选择是使用完整的依赖项列表更新Pipfile。