Rails – Deploying to Heroku – Postgres

I find myself coming back to the same set of notes every time I am about to deploy. Here is my workflow for deploying my rails apps to heroku, enjoy.

Step 1: – Open up your terminal and create a new application on heroku:

heroku create

Step 2: – Declare your ruby version in your gemfile

ruby '1.9.3'

Step 3: – Add this to config/applications.rb

config.assets.initialize_on_precompile = false

Step 4 – Push your git repository to heroku

git push heroku master

Step 5 – Include postgres add on

heroku addons | grep POSTGRES

Step 6 – Add it to development

heroku addons:add heroku-postgresql:dev

Step 7 – Create Database

heroku run rake db:create

Step 8 – Migrate Database

heroku run rake db:migrate

Step 9 – Domain

heroku domains:add www.example.com

cname and dns

https://devcenter.heroku.com/articles/custom-domains