How to deploy Ruby app on Heroku

Documentation is available on Heroku site.

Installation: Brief steps are as follows:

First create a free account with Heroku.

Download and install Heroku CLI (Command Line Interface) on your local machine.

$heroku login

$heroku update

$heroku create [project_name] # When you create an app, a git remote (called heroku) is also created and associated with your local git repository.

Note: If the app already exists on Heroku and you want to link to it from new computer, refer to

$git remote -v

$heroku git:remote -a existing_projectname

$git push heroku master # Push local code to Heroku server

$heroku run rake db:migrate

$heroku open # launch the application on heroku server


$heroku logs --tail # shows the log real-time tail

$heroku ps # check how many dynos are running, how much free usage quota is remaining

$heroku local web

$heroku local

$heroku addons

$heroku pg

$heroku pg:psql

$heroku keys:add

$git push heroku master

$heroku pg:psql # interact directly with the database if you have Postgres installed locally.

$heroku run rails console # run irb on heroku server


Once in a while, when deploying your app to heroku server, you may see a message as follows:

 »   Warning: heroku update available from 7.42.6 to 7.42.13.

Then you need to upgrade heroku-cli using following command.

$heroku update

$heroku --version # to verify the version