我正在尝试将一个小的Flask应用程序放到Heroku上。当它启动时,从日志中给了我以下信息:
2015-03-11T01:05:26.737788+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-11T01:05:31.409851+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2015-03-11T01:05:33.863601+00:00 app[web.1]: bash: gunicorn: command not found
2015-03-11T01:05:34.644419+00:00 heroku[web.1]: Process exited with status 127
2015-03-11T01:05:34.668264+00:00 heroku[web.1]: State changed from starting to crashed
我的 Procfile 是
web: gunicorn application:app
我的目标是运行application.py这个文件。我查了一下这个问题,发现有时是由于requirements.txt中没有gunicorn导致的,但我的requirements.txt里有它,它被列在这一行中:
and application.py 是我要运行的文件。我查了一下这个问题,发现有时是由于 requirements.txt 中没有 gunicorn 导致的,但我的 requirements.txt 里有它,包含以下这行:
gunicorn==19.3.0
我尝试运行。heroku run pip install gunicorn
它告诉我已经成功安装了 gunicorn-19.3.0。但是当我在 Heroku 上尝试运行它时,出现了问题。
heroku run gunicorn
运行它后出现了"bash: gunicorn: command not found"的错误信息。