簡體   English   中英

Heroku Django webapp 獲取錯誤日志說找不到 gunicorn 命令但它在那里

[英]Heroku Django webapp getting error logs say gunicorn command not found but it is there

我正在嘗試使用 postgresql 在 heroku 上運行一個 django 應用程序,但是當我轉到我的應用程序 url 時,我正在檢查 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

我嘗試使用heroku run pip install -r requirements.txt遠程安裝 gunicorn

但我得到› Error: remote requirements.txt not found in git remotes

我也在使用 Django,在我將更新推送到 Heroku 幾分鍾后,在heroku logs --tail 在推送到 Heroku 之前,一切都運行良好。

為了解決這個問題,首先我確保以下以前工作的文件在推送時保持不變:

  • 要求.txt
  • 文件
  • 簡介
  • 運行
  • wsgi

由於這些文件保持不變,我斷定是我不了解的東西導致了問題。 所以我進入了應用程序在 Heroku 中的Activity Feed ,找到了我知道有效的版本並單擊了Roll back to here鏈接。

當這不起作用時,根據另一個用戶的建議(我現在似乎找不到他的評論),我從requirements.txt中刪除了所有包,然后將其推送到 Heroku,以便所有包都將在應用程序。 然后我將所有包添加回requirements.txt並將其推送到 Heroku。 現在可以了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM