我已經用nginx,passenger,ruby 1.9.3-p194和rails 3.2.6正確安裝了我的Linode VPS。我已經構建了一個簡單的Cap配方(見下文),它通過了deploy:setup和deploy:check,但是在資產預編譯階段失敗。我會嘗試在遠程服務器上手動運行預編譯,但Cap回滾,所以我不能這樣做。與Capistrano部署Rails 3.2.6應用程序的問題
錯誤看起來像一個PG錯誤,但我已經測試了一個基於我的database.yml設置手動連接到服務器的連接,它的工作原理是完美的。任何想法這可能是什麼?
deploy.rb
require "bundler/capistrano"
server "50.116.25.145", :web, :app, :db, primary: true
set :application, "exigencad"
set :user, "deploy"
set :deploy_to, "/home/#{user}/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, "git"
set :repository, "[email protected]: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 :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
task :after_update_code do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end
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: ["50.116.25.145"]
[50.116.25.145] executing command
** [out :: 50.116.25.145] rake aborted!
** [out :: 50.116.25.145] FATAL: Peer authentication failed for user "exigen"
** [out :: 50.116.25.145]
** [out :: 50.116.25.145] Tasks: TOP => environment
** [out :: 50.116.25.145]
** [out :: 50.116.25.145] (See full trace by running task with --trace)
command finished in 6433ms
*** [deploy:update_code] rolling back
這是全部運行在一臺服務器上,對吧? –