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

问题描述 投票:0回答:1

我正在尝试使用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,安装了heroku python buildpack的requirements.txt文件

我尝试通过以下方式远程安装gunicornheroku run pip install -r requirements.txt

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

python django heroku
1个回答
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。现在可以了。

© www.soinside.com 2019 - 2024. All rights reserved.