2

I pushed my Flask app to Heroku couple months ago https://shakespeare-tweet.herokuapp.com/ (live) here's the screen shot of the local host: https://berkeley.app.box.com/file/303628505050 But I tried to update it, and it keeps breaking:

Here's stackoverflow solution: Heroku + gunicorn not working (bash: gunicorn: command not found )

but when I update it to the new version, it gives me the error Heroku + gunicorn not working (bash: gunicorn: command not found )

web: gunicorn myapp:app --log-file=- But the app crashes when deployed:

bash: gunicorn: command not found I tried adding the heroku python buildpack, but no luck. If I roll back to a previous commit (where requirements.txt and Procile are both unchanged).

I still get the same error log:

2018-07-10T21:52:11.855058+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shakespeare-tweet-pr-16.herokuapp.com request_id=068bae51-052e-4bf4-9b25-336c9a036709 fwd="165.124.160.252" dyno= connect= service= status=503 bytes= protocol=https
2018-07-10T21:52:31.144603+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-10T21:52:34.984576+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2018-07-10T21:52:36.771041+00:00 heroku[web.1]: Process exited with status 127
2018-07-10T21:52:36.714985+00:00 app[web.1]: bash: gunicorn: command not found
2018-07-10T21:52:36.787124+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-10T21:52:36.789041+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-10T21:52:40.971471+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2018-07-10T21:52:42.677787+00:00 heroku[web.1]: Process exited with status 127
2018-07-10T21:52:42.692987+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-10T21:52:42.618587+00:00 app[web.1]: bash: gunicorn: command not found
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
Connection to log stream failed. Please try again later.

I would appreciate any help with this issue.
JeffreyC
  • 625
  • 1
  • 8
  • 19

2 Answers2

8

Okay, the issue here is that the shakespeare-tweet-pr-16 app was built using pipenv so it will take the dependencies from the Pipfile, not the requirements.txt. The Pipfile only lists flask as a dependency so Gunicorn has not be installed which is why it can't be found. I would recommend you remove the Pipfile from your app. The other option is to update the Pipfile with your full dependency list.

JeffreyC
  • 625
  • 1
  • 8
  • 19
0

Here is my answer, late it is but in the hope of helping yourself and others.

--log-file=- bash: gunicorn: command not found

So you're gunicorn is recognised but the command is not.

I solved the problem by adding a space after the - therefore: --log-file - There is no need for the =

nizarhamood
  • 91
  • 10