This article uses Ruby 2.6.5 installed on macOS Catalina 10.15.6.
When an error occurs on Heroku, you need to check the error log and resolve the error. It can be solved by the following 5 steps.
When I accessed Heroku, the contents of the image below were displayed.
The site does not know the specific content of the error, so check the error log in the terminal.
terminal
heroku logs --tail --app <<Application name>>
If you enter, the error log will be displayed.
Look for the log where the error actually occurred.
Make a hypothesis of the cause from the content of the error and think of a solution.
The error content is that the comment table does not exist on Heroku, so it is predicted that the migration content is not reflected in the database on Heroku. If you execute migration on Heroku, it may be solved.
Actually verify.
terminal
heroku run rails db:migrate
After execution, access again. Solved safely!
What to do if an error occurs on Heroku Roughly divided into 3 steps ・ Output error log ・ Discover the latest error ・ Hypothesis verification that's all.
Thank you for reading to the end! I hope it helps those who are facing similar challenges!
Recommended Posts