Take the 2-minute tour ×

I've setup my Linode VPS properly with nginx, passenger, ruby 1.9.3-p194, and rails 3.2.6. I've built a simple Cap recipe (see below) which passes deploy:setup and deploy:check but fails on the assets precompile phase. I would try to run the precompile by hand on the remote server but Cap rollsback so I can't do it.

The error looks like a PG error however I've tested a connection manually to the server based off my database.yml settings and it works perfect. Any idea what this could be?

require "bundler/capistrano"

server "", :web, :app, :db, primary: true

set :application, "exigencad"
set :user, "deploy"
set :deploy_via, :remote_cache
set :use_sudo, false

set :scm, "git"
set :repository, "git@github.com:teknull/#{application}.git"
set :branch, "master"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

after "deploy", "deploy:cleanup" # keep only the last 5 releases

namespace :deploy do
  task :start do ; end
  task :stop do ; end

task :after_update_code do  
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"

after :deploy, "assets:precompile"

Error from Capistrano:
executing `deploy:assets:precompile'
  * executing "cd /home/deploy/exigencad/releases/20120621170601 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
    servers: [""]
    [] executing command
 ** [out ::] rake aborted!
 ** [out ::] FATAL:  Peer authentication failed for user "exigen"
 ** [out ::] 
 ** [out ::] Tasks: TOP => environment
 ** [out ::] 
 ** [out ::] (See full trace by running task with --trace)
    command finished in 6433ms
*** [deploy:update_code] rolling back
share|improve this question
This is all running on a single server, right? –  Mike Sherrill 'Cat Recall' Jun 21 '12 at 18:26
add comment

2 Answers

might be totally unrelated to your problem, but since i just hit the same error while running cap deploy:migrate i'll mention it. did you set host: localhost for your production db in database.yml? adding that line fixed the problem for me.

share|improve this answer
This worked for me. I had the same issue, even rake db:migrate worked on the server; but cap would still fail with "Peer authentication failed" –  chaostheory Oct 31 '12 at 8:04
add comment

Try add config.assets.initialize_on_precompile = false to your application.rb file,that help me.

share|improve this answer
add comment

Your Answer


