Heroku offers Ruby web developers instant deployment, fast & easy scaling, and vast tool selection. Now we can concentrate on building our applications and forget the tedious deployment and server administration tasks that used to strangle our productivity. We can deploy fast, scale quickly, and adjust to circumstance as needs arise.
This article will explain to you how to deploy your applications on the popular platform. It is cloud based application platform for easy deployment of your applications. The integration with Cloud9 IDE makes your development process even more agile.
When you use the platform for deploying your application you need to make sure of the following-
1. B y default the cloud platform will have shared database and it will be postgresql database.
2. All your migrations must be postgresql compatible.
3. Use pg gem in your application
4. You need to have suitable addons of heroku for deploying your application
Specify heroku gem in your gem file of app that you want to deploy
$ bundle install
SSH Key Generation:
$ ssh-keygen -t rsa
The above command will generate public key inside /home/Username/.ssh/id_rsa.pub
$ heroku accounts:add
Account name should be your heroku login
1. Initialize pg gem in your Gemfile in order to use postgresql database.
2. Bundle install after initializing the gem
$ bundle install
3. Even though you are using SVN repository, it’s better to use git repository for deploying your applications to the cloud platform. If you are using SVN and if you would like to initialize git repository only to push updates to heroku then follow the steps below
$ git init
$ git add .
$ git commit -m “init”
This creates a local git repository where you will be adding the files which you update or add from your svn repository.
If you have to work with the cloud platform from your application you should generate ssh keys and add the public key to the heroku.
You can do it from the steps given here:
4.After adding the keys login to the cloud platform using the command below with the credentials and check whether you are able to login.
$ heroku login Enter your Heroku credentials. Email: [email protected] Password: Could not find an existing public key. Would you like to generate one? [Yn] Generating new SSH public key. Uploading ssh public key /Users/name/.ssh/id_rsa.pub
5. If you are able to login to the cloud application, then from your application folder create an application in heroku using
ceder rack of heroku
$ heroku create –stack cedar myap
6. After creating the application you need have a remote repository and one remote git repository should be added to heroku also.
$ git remote -v
$ git remote add heroku [email protected]:myapp.
$ git init
This creates a remote repository in heroku and will be initialized with the local repository.
7. Since you will be using SVN repository you ne