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 https://devcenter.heroku.com/articles/git

$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

Debugging

$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

 

 

 

 

 

 

 

Rating: