About this article
After deploying on Heroku, it is not reflected in the production environment and deploy again I was able to solve it safely, so I posted it as a memorandum!
[environment] ・ Ruby 2.6.5, Rails 6.0.0 ・ MacOS
When creating an application with rails, deploy it with Heroku to check the movement in the production environment. The first time it worked fine, but the second time a problem occurred. The view is similar to the local environment Since it is not implemented, it cannot be solved by trial and error. When I asked the mentor, I was able to solve it by doing one new operation.
The following are all operations at the terminal.
$ git commit --allow-empty -m "Any commit message"
→ Normally, you cannot commit/push if there is no difference, but a command that forcibly executes even if there is no difference
The rest is the same flow as normal deployment to Heroku.
$ git push heroku master
$ heroku run raills db:migrate
Check in the production environment and if there is no problem, it is completed.
At the end
It's easy to get impatient if it doesn't work in the same way in the production environment even though there is no problem in the local environment. Just knowing that a command like this can solve it will make you mentally stable!