After a long time, I worked on hosting Ruby on Rails 5 using Heroku. I’ll introduce the steps to deploy to Heroku as a memorandum.
I used Heroku for the first time in several years, and it has evolved wonderfully.
Since Heroku’s default database is PostgreSQL, let’s use rails new to use this.
rails new yourapp --database=postgresql
There are probably other options you can specify for rails new, but use them as you prefer.
I completed the work from creating the Heroku app to deployment by referring to the following articles.
Basically, reading the first Heroku official documentation is sufficient, but if you’re not good with English, I think it’s good to read the second Qiita article as supplementary information.
I recommend reading the Qiita article including the comments section.
The minimum required Heroku add-on for deploying Rails apps to Heroku is just Heroku Postgres, so I’ll add this add-on.
heroku addons:create heroku-postgresql:hobby-dev
There are many other convenient Heroku add-ons, but the minimum requirement is just Heroku Postgres, so let’s add other add-ons later.
First, the priority task is to host and confirm that the app starts up.
Finally, with the familiar git push heroku master, if you can host the Rails app on Heroku, the work is complete.
Since I wrote this article as a memorandum for myself, for detailed content, it’s repetitive, but please refer to:
and try it out.
That’s all from the Gemba, where I deployed Ruby on Rails 5 to Heroku using Heroku after a long time.