On Dec 15, 11:08 pm, Jamis Buck <[email protected]> wrote:
> Do you have anything in ~/.ssh/config? Or ~/.caprc? Any chance you could
> show more of your capfile and deploy.rb?
>
> - Jamis
I've several RSA keys listed for my VPS host in ~/.ssh/config:
Host [remote-host-ip]
User local-username
Hostname [remote-host-ip]
IdentityFile ~/.ssh/vps_me_rsa
Host [remote-host-ip]
User rails-app-user
Hostname [remote-host-ip]
IdentityFile ~/.ssh/vps_rails_app_rsa
If I place 'rails-app-user' on top, Capistrano authenticates as 'rails-
app-user'. I've noticed that Cap always uses the first username in
~/.ssh/config listed for the host.
Still, cap deploy:check fails for me when logged in as [rails-app-
user]:
The following dependencies failed. Please check them and try
again:
--> You do not have permissions to write to `/home/users/rails-
app-user/rails'. ([remote-host-ip])
--> You do not have permissions to write to `/home/users/rails-
app-user/rails/releases'. ([remote-host-ip])
(This must be caused by the connection to the Git repo which is on the
same server and is accessed via 'git' user.) My deploy.rb:
#############################################################
# Application
#############################################################
set :application, "rails-app-user"
set :deploy_to, "/home/users/#{application}/rails"
#############################################################
# Settings
#############################################################
#default_run_options[:pty] = true
set :use_sudo, false
set :keep_releases, 3
set :port, #[port]#
ssh_options[:username] = 'rails-app-user'
ssh_options[:verbose] = :debug
#############################################################
# Servers
#############################################################
set :user, "rails-app-user"
set :domain, "[remote-host-ip]"
server domain, :app, :web
role :db, domain, :primary => true
#############################################################
# Subversion
#############################################################
set :scm, :git
set :repository, "ssh://g...@remote-host-ip:port/home/git/#
{application}"
set :branch, "master"
set :deploy_via, :remote_cache
#############################################################
# Passenger
#############################################################
namespace :passenger do
desc "Restart Application"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task isn't used with mod_rails"
task t, :roles => :app do ; end
end
end
after :deploy, "passenger:restart"
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---