title: Capistrano 3 upgrade problems
body: <p>I've been trying to upgrade from Capistrano 2 to Capistrano 3, but have been working through all the errors. I'm stuck on one that I don't know how to solve now. I'm using Unicorn and Nginx. </p>
  
  <p>Error trace:</p>
  
  <pre><code>cap production deploy:cold --trace
  ** Invoke production (first_time)
  ** Execute production
  ** Invoke load:defaults (first_time)
  ** Execute load:defaults
  cap aborted!
  Task Argument Error
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task_manager.rb:96:in `resolve_args_with_dependencies'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task_manager.rb:62:in `resolve_args'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task_manager.rb:24:in `define_task'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:360:in `define_task'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/dsl_definition.rb:32:in `task'
  config/deploy.rb:31:in `block (2 levels) in &lt;top (required)&gt;'
  config/deploy.rb:29:in `each'
  config/deploy.rb:29:in `block in &lt;top (required)&gt;'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task_manager.rb:196:in `in_namespace'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/dsl_definition.rb:104:in `namespace'
  config/deploy.rb:28:in `&lt;top (required)&gt;'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/capistrano-3.0.1/lib/capistrano/setup.rb:12:in `load'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/capistrano-3.0.1/lib/capistrano/setup.rb:12:in `block (2 levels) in &lt;top (required)&gt;'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in `run'
  /Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/capistrano-3.0.1/bin/cap:3:in `&lt;top (required)&gt;'
  /Users/devanb/.rbenv/versions/2.0.0-p247/bin/cap:23:in `load'
  /Users/devanb/.rbenv/versions/2.0.0-p247/bin/cap:23:in `&lt;main&gt;'
  Tasks: TOP =&gt; production
  </code></pre>
  
  <p>Deploy file:</p>
  
  <pre><code>set :application, 'liveinbham'
  set :user, 'deployer'
  
  set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
  set :scm, "git"
  set :repo_url, 'git@github.com:DevanB/LIveInBham.git'
  set :use_sudo, false
  
  set :scm_verbose, true
  set :git_shallow_clone, 1
  set :git_enable_submodules, 1
  
  set :ssh_options, { :forward_agent =&gt; true }
  
  set :stage, :production
  set :rails_env, "production"
  set :branch, "master"
  
  set :pty, true
  
  set :linked_files, %w{config/database.yml}
  set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
  
  set :keep_releases, 5
  
  namespace :deploy do
    %w{start stop restart}.each do |command|
      desc "#{command} unicorn server"
      task command, roles: :app, except: {no_release: true} do
        run "/etc/init.d/unicorn_#{fetch(:application)} #{command}"
      end
    end
  
    task :setup_config, roles: :app do
      sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{fetch(:application)}"
      sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{fetch(:application)}"
    end
    after "deploy:setup", "deploy:setup_config"
  
    after :finishing, 'deploy:cleanup'
  end
  
  desc "tail log files"
  task :tail, :roles =&gt; :app do
    run "tail -f /home/#{fetch(:user)}/apps/#{fetch(:application)}/current/log/production.log" do |channel, stream, data|
      puts "#{channel[:host]}: #{data}"
      break if stream == :err
    end
  end
  
  desc "Open the rails console on one of the remote servers"
  task :console, :roles =&gt; :app do
    hostname = find_servers_for_task(current_task).first
    exec "ssh -l #{fetch(:user)} #{hostname} -t 'source ~/.profile &amp;&amp; #{current_path}/script/rails c #{fetch(:rails_env)}'"
  end
  </code></pre>