Install Capistrano
gem install capistrano
Run from the project root of your application.
capify .
This will generate the necessary files.
To add multistage support add the capistrano-ext to your Gemfile.
Capistrano will look for environments in config/deploy/[the environment name].rb, in our case config/deploy/staging.rb.
NOTE: If using RVM (it's awesome) on your remote server, you will need to specify some environment variables. Typically, my environments mirror each other in staging and production so they tend to be the same and therefore, shared in the config/deploy.rb script. If this is not the case, put the :default_environment directive in the deploy specific environment file.
To find out what the values are for your environment, on the remote machine run
rvm info
Find the hash keys in the output and plug them in.