Heroku Django Webapp收到错误日志,提示未找到gunicorn命令,但它在那里

时间:2018-08-27 13:54:58

标签: python django heroku

我正在尝试使用postgresql在heroku上运行django应用程序,但是我正在 当我转到应用程序网址时,我会检查heroku日志--tail并查看

2018-08-27T10:37:19.086599+00:00 heroku[web.1]: State changed from starting to crashed 2018-08-27T10:37:19.070449+00:00 heroku[web.1]: Process exited with status 127 2018-08-27T10:37:18.986150+00:00 app[web.1]: bash: gunicorn: command not found 我有一个gunicorn的requirements.txt文件,安装了heroku python buildpack

我尝试使用以下方法远程安装gunicorn heroku run pip install -r requirements.txt

但是我明白了 › Error: remote requirements.txt not found in git remotes

1 个答案:

答案 0 :(得分:0)

我也在使用Django,在我将更新推送到Heroku几分钟后,在heroku logs --tail中看到了同样的错误。在推向Heroku之前,一切正常。

要解决此问题,首先,我要确保以前使用的以下文件在推送时保持不变:

  • requirements.txt
  • Aptfile
  • Procfile
  • 运行时
  • wsgi

由于这些文件保持不变,所以我得出结论,就是我所不知道的原因导致了问题。因此,我进入了Heroku中应用程序的Activity Feed,找到了我所知道的版本,然后单击了Roll back to here链接。

如果这不起作用,根据另一个用户的推荐(现在似乎找不到我的评论),我从requirements.txt中删除了所有软件包,然后将其推送到Heroku,以便所有软件包将在应用程序中卸载。然后,我将所有软件包重新添加到requirements.txt并将其推送到Heroku。现在可以了。