Deploy the demo application to Heroku
Prerequisites:
1.Rails Application
2.Git
3.Heroku Account
4.Heroku gem
1.Rails application:
http://gowithfoss.wordpress.com/2011/02/02/create-rails-application/
2. Install git:
step1:
$sudo apt-get install git-core
step3:Now enter into your project directory
$cd sample
step4:Now Initialize empty Git repository to add your application
$git init
Git will reply
Initialised empty Git repository in .git/
and also create .git/ folder in your project
step5:Add your project files in to the empty Git repository
$git add . # (.specify current directory)
step6:Now you can commit your project
$git commit -m “Initial repository” #”commited comment “
Now git installed and add initial repository successfully
github:
To add your application from local git repository to github repo
create an account in github.com
to add application to github need to create remote between local repo and github repo
$ sudo apt-get install ssh
if already ssh installed means you generate a new key using following commands
$ ssh-keygen -t rsa -C “k.sanmugam2@gmail.com” # your mail id
it reply
to add ur ssh key to github site
$cd ~/.ssh
$gedit id_rsa.pub
to copy the whole content
and open your github.com account and go account settings=>ssh publc keys=>add another public key=> to paste your key in the key field
and create a repository in dashboard
configure git with the ur system and git account at first time only
$ cd project_dir # go to ur project directory
$ git config –global user.name “sanmugam”
$ git config –global user.email k.sanmugam2@gmail.com
above two steps are first time paring only
now create new repository in GitHub
after created it shows like
now
$ git remote add origin git@github.com:sanmugamk/sample.git
$ git push origin master
successfully upload local git repo to github repo..
3.Create a Heroku account:
here http://heroku.com/
4.Now we create heroku application
step1:install heroku through gem
$sudo gem install heroku
step2:It upload SSH public key
$heroku keys:add
it reply
Uploading ssh public key /home/sanmugam/.ssh/id_rsa.pub
step3:Now create our application with heroku
$heroku create sample #Enter name of your application
step4: Deploy to Heroku
to deploy heroku by git push
$git push heroku master
step5:Migrate heroku database
$heroku rake db:migrate
step6:start your project in heroku
$heroku open
It deployed successfully



nice posts
Good post…..really nice one
Thanks, good stuff ….