Ruby on Rails application Deploying in Heroku

Deploying ROR application in heroku is not a rocket science  now but some developer is having some confusion with this thing so only this blog post , So this post not for experienced developers 🙂

The first thing you need to understand heroku uses git for deployment , so that you need to have git repository in your ROR application first .

Then you need to install heroku toolbelt go here to get tool-belt for your OS , then install heroku gem

gem install heroku

If you don’t have heroku account create one, then on your terminal type

heroku login

It will asks your credentials give them, then go to your application directory by terminal and type

heroku create optional-app-name

If you give application name it will create DNS same like that otherwise it will generate one for you.Then type

git push heroku master

It will push your code to heroku , It uses SSH to access , This is first time in your system to connect with heroku and using SSH means , type

ssh-keygen -t rsa

heroku keys:add

note: Heroku uses pg as default data base, so please ensure you have included gem ‘pg’ in your gem file.

If you have any problem with ssh see