title: capistrano with ubuntu ec2 instance to deploy ruby on rails
body: <p>I am trying to implement ruby on rails app using Capistrano, I am running apache rvm in the staging server and nginx REE version in production server. I am using git also. 
  I have been try to integrate Capistrano but I am getting the this error </p>
  
  <pre><code>(Net::SSH::AuthenticationFailed: ubuntu)
  </code></pre>
  
  <p>Here is my deploy.rb  file </p>
  
  <pre><code>set :application, "capify"
  
  # The directory on the EC2 node that will be deployed to
  set :deploy_to, "/home/ubuntu/apps/#{application}"
  
  set :keep_releases, 3
  
  # deploy with git
  set :scm, :git
  set :repository,  "git@github.com:username/capify.git"
  set :git_shallow_clone, 1
  set :branch, "master"
  set :use_sudo, false
  
  set :user, "ubuntu"
  ssh_options[:keys] = ["/path/tp/key.pem"]
  ssh_options[:forward_agent] = true
  default_run_options[:pty] = true
  
  # The address of the remote host on EC2 (the Public DNS address)
  set :location, "ip"
  
  # setup some Capistrano roles
  role :app, location
  role :web, location
  role :db,  location, :primary =&gt; true
  
  after 'deploy:update_code', 'deploy:symlink_db'
  
  
  namespace :deploy do
  
  desc "Restart Application"
  task :restart, :roles =&gt; :app do
  run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
  end
  
  desc "Symlinks the database.yml"
  task :symlink_db, :roles =&gt; :app do
  run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
  end
  
  end
  </code></pre>
  
  <p>Unable to figure the exact problem and the methods to integrate capistrano.</p>