Stiaannel
Blog

Deploying a rails app to heroku(Basic Guideline)

Introduction

Hey, lets discuss getting a ruby on rails application up and running to heroku. This guide is built from my personal experiences and also contains points/mentions from a ruby on rails course I did a while back.

Getting ready for deployment

This guide assumes yyou are not going to use pg to manage your local development db. If you won’t be using sqlite3, simply replace the gem with gem 'pg'

  1. Install heroku-cli
  2. log into heroku-cli
  3. create an heroku application
  4. in gemfile move sqlite3 to a new “Development && test” section
  5. add gem ‘pg’ to group production (PostgreSQL)
  6. deploy to the app from heroku dashboard deployments section, (or use git push heroku main after ensuring heroku remotes are added)
group :production do 
  gem 'pg' # Use Postgres for HEROKU
end

Your app should now be deployed.

Note this is a VERY basic, non detailled guide. For a detailed guide rather use the guide made by heroku themselves: Heroku guide