[Ruby] Deploy to Heroku (for editing after the second time)

1 minute read

What you can see in this article

① How to create an app on Heroku and deploy the changes edited locally locally.

:thinking: Note that it’s not for first-time app creators!

As a premise

The directory has moved to the app being created. The application is made with Rails. ―― ―― ―― ―― :hugging: Let’s go for the first time from here :hugging:

Command flow

(1) Bundle installation when changing or adding Gemfile. I will go anyway.

% bundle install

―― ―― ② Commit changes

% git add.
% git commit -m "Add pg gem for Heroku"

―― ―― ③ Push the repository and deploy the application.

% git push heroku master

―― ―― ④ DB migration. I think that it is work for production environment Heroku.

% heroku run rake db:migrate

―― Try opening the app now! It should have been deployed: v_tone1::crown: ―― Thank you for your hard work! ―― ―― ―― ――

This article is a new record for beginners. I have referred to the following article. Reference article ([When deploying Rails app on Heroku for the first time and getting an error] https://qiita.com/hmmrjn/items/e2dff8036fbbd74f049a) ―― ―― ――

Memo

I am When deploying, an error often occurred in the process of ③. The reason was that I forgot the process of “% bundle install”. ―― ―― It seems that it happened because I had to change the Gemfile when copying it to the production environment. ―― ―― ――

―― Thank you for reading to the end! see you! :blush::wave_tone1: