Saturday, February 21, 2009

Deploy on Server

Move Few Steps to Deploy Ruby code on Server

The Followings steps help you the deploy your ruby code on server from your local environment. you need to have capistrano 2.2.0 and railsmachine 1.0.0 installed locally or upgraded version.

1) Need to install rails-machine.

c:\> gem install railsmachine

if you find any problem then directly download .gem file from
After downloading the gem file try this.

c:\> gem install railsmachine-1.0.1.gem

2)Install Capistrano with all dependancies

gem install -y capistrano

if you find any problem then download directly from

3) Capify your application

c:> capify .

Now the deploy.rb file will created under /config/deploy.rb.

4) Configure Capistrano for Rails Machine

c:> railsmachine --apply-to . --name my_app --domain

5) Modify the deploy.rb as per your requirements(if any)

6) Deploy the Code

c:\ cap deploy

or,if you need to run migrations as well

c:\ cap deploy:migrations


  1. Hi Hitesh,

    I have followed the steps you have mentioned but getting error
    svn: Connection closed unexpectedly

    Details of error
    * executing `deploy'
    * executing `deploy:update'
    ** transaction: start
    * executing `deploy:update_code'
    svn: Connection closed unexpectedly
    *** [deploy:update_code] rolling back

    c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/subversion.rb:58:in `query_revision': tried to run `svn info svn+ssh: ..............
    from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `send'.......

    Could you please help me on this?

  2. Hey ,
    I have the same problem.
    please let us know what I need to do ?


  3. You Need to modify config file of Subversion.

    add this line in the config file

    ssh = plink.exe
    ssh=plink.exe -i putty/private_key.ppk -l deploy -pw xxxxxx

    this plink file is in your putty dir. you also require pageant which reads authentication from .ppk file.