【问题标题】:Heroku gunicorn absenceHeroku gunicorn 缺席
【发布时间】:2013-05-18 04:08:21
【问题描述】:

尝试将我的 Django 应用上传到 Heroku 并获得:

2013-05-22T23:04:55.687398+00:00 heroku[web.1]: Starting process with command `gunicorn main.wsgi`
2013-05-22T23:04:56.508882+00:00 app[web.1]: bash: gunicorn: command not found
2013-05-22T23:04:57.958215+00:00 heroku[web.1]: State changed from starting to crashed
2013-05-22T23:04:57.941729+00:00 heroku[web.1]: Process exited with status 127
2013-05-22T23:05:06.019313+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-05-22T23:05:06.019520+00:00 heroku[web.1]: Stopping process with SIGKILL

我知道 gunicorn 在 requirements.txt 中并且已经推送了它,所以它应该可以正常工作。该应用程序与工头一起运行。

有人对可能出现的问题有任何建议吗?

【问题讨论】:

    标签: django heroku gunicorn


    【解决方案1】:

    有时,Heroku 的构建包会以完全奇怪的方式失败。

    试试这个:

     heroku run pip install gunicorn
    

    看看会发生什么。

    【讨论】:

    • 谢谢。这引发了bash: pip: command not found。根据bit.ly/13NxljQ,尚不清楚它是否会起作用。我还尝试了heroku run bash,它给了我一个 bash 终端。不知道接下来会发生什么..
    • 好的,那么您没有正确的构建包。输入 heroku config 并告诉我 BUILDPACK_URL 是什么。
    • 我这样做了,但它没有返回 BUILDPACK_URL。我只得到 DATABASE_URL 和 HEROKU_POSTGRESQL_MAROON_URL ,它们都是 postgres:// 前缀的 URL。谢谢。
    • 好吧,如果它没有找到 pip,它不认为它是一个 Python 应用程序,无论出于何种原因。运行heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-python,在你的仓库中提交并推送。
    【解决方案2】:

    我不小心推送了一个 .bash_profile,该 .bash_profile 已进入我的项目,并且正在设置 PATH,从而对 heroku 堆栈造成严重破坏。

    【讨论】:

      【解决方案3】:

      我只是按照 Jack Shedd 所说的做了,对我来说效果很好。

      运行:

      herouku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-python
      

      然后,在您的存储库中进行提交。最后,做:

      git push heroku master
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-12-15
        • 2017-06-02
        • 1970-01-01
        • 2018-12-28
        • 2016-01-06
        • 2018-11-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多