(1) Create a working directory (2) Set up a virtual environment (3) Install the necessary framework and WEB server (4) Create Flask file in Python (5) Try running the Flask file (6) Deploy to Heroku ① Register an account with Heroku ② Install Heroku with Homebrew ③ Prepare Git ④ Create an app on Heroku ⑤ Link the local app with the Heroku app ⑥ Create the files required for deployment to Heroku ⑦ Deploy to Heroku (7) Error handling ① Heroku ps: scale web = 1 is normal ② Heroku ps: scale web = 1 is not normal (8) Update the file
When I typed the following and deployed it, the following error message was displayed in the browser.
heroku open
Enter the following in the terminal and check the log.
heroku logs --tail
Then
heroku[router]: at=error code=H14 desc="No web processes running"
Message.
If you google code = 14, the details are written on the following site https://github.com/herokaijp/devcenter/wiki/error-codes
heroku ps:scale web=1
As
heroku open
Then
I was able to deploy successfully.
When I googled code = 14, the details are written on the following site, but it did not improve.
Once again, when I checked the files needed for deployment, I found a typo in the Procfile. (Wrong) web: gunicorn hello: app --log-file- (Correct) web: gunicorn hello: app --log-file- There was no space after the :.
Correct it and proceed as follows again.
git status
The updated file is displayed as shown below.
modified: Procfile
This time, enter it as'the-second'.
git commit -m'the-second'
git push heroku master
heroku open
The following was successfully displayed on the browser, and the deployment was successful.
Basically, you can add or modify the file as in (7) ② and deploy it to Heroku.
Recommended Posts