title: Capistrano Deploy to EC2, User Permissions
body: <p>I have a rails app that I am trying to deploy to an ec2 instance using Capistrano. My <code>deploy.rb</code>:</p>
  
  <pre><code>set :application, "uc_social_server"
  set :repository,  "septerr@bitbucket.org/urbancoding/uc_social_server.git"
  set :user, "ec2-user"
  server "ec2-23-22-188-11.compute-1.amazonaws.com", :app, :web, :db, :primary =&gt; true
  set :deploy_to, "/home/ec2-user/uc_social_server"
  ssh_options[:keys] = %w(/Users/sony/.ssh/ec2-social-server-key.pem)
  default_run_options[:pty] = true
  </code></pre>
  
  <p>Running <code>cap deploy:check</code> fails with:</p>
  
  <pre><code>The following dependencies failed. Please check them and try again:
  --&gt; You do not have permissions to write to `/home/ec2-user/uc_social_server/releases'. (ec2-23-22-188-11.compute-1.amazonaws.com)
  </code></pre>
  
  <p>I have tried some of the solutions I found on stackoverflow without success. What is the correct way to deploy to ec2 with capistrano? </p>