简体   繁体   中英

Ruby on Rails AWS Cap Deploy Permission Denied

I'm trying to deploy an app to an amazon webserver. I have git installed and functioning (I already successfully made a push. But when I try to do cap deploy I get "permission denied"

Here's the error:

   servers: ["22.229.78.34"]
   [ubuntu@22.229.78.34] executing command
   ** [22.229.78.34 :: out] Cloning into '/home/ubuntu/liquid_admin/releases    /20130703153332'...
   ** [22.229.78.34 :: out] Permission denied (publickey).
   ** fatal: The remote end hung up unexpectedly
   command finished in 779ms
   *** [deploy:update_code] rolling back

And here's the deploy file:

require 'bundler/capistrano'
set :user, 'ubuntu'
set :domain, 'ubuntu@22.229.78.34'
set :applicationdir, "~/liquid_admin"

set :scm, 'git'
set :repository,  "ssh://ubuntu@22.229.78.34/~/liquid_admin.git"
set :git_enable_submodules, 1 # if you have vendored rails
set :branch, 'master'
set :git_shallow_clone, 1
set :scm_verbose, true
set :application, "liquid.radio"

# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent      guess based on known version control directory names   

Or: accurev , bzr , cvs , darcs , git , mercurial , perforce , subversion or none

role :web, "ubuntu@22.229.78.34"                          # Your HTTP server, Apache/etc
role :app, "ubuntu@22.229.78.34"                          # This may be the same as your `   Web` server
role :db,  "ubuntu@22.229.78.34", :primary => true # This is where Rails migrations will run

set :deploy_to, "~/liquid_admin"
set :deploy_via, :export

default_run_options[:pty] = true

namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do

Probably a silly time to ask, but I'm wondering if I need to already have ruby and rails installed for this to work. I'm going to do it right now anyway... but I was just wondering (didn't know if cap does it for you.)

But other than that..why would it be failing?

Again git is setup and running fine. Push worked just great. SSH is working fine. Another thing I should note is that I tried it both with running ubuntu@22.229.78.34 and with just running 22.229.78.34. I did it the ubuntu way because that's usually the only way amazon will accept a connection. Any help would be appreciated.

** [22.229.78.34 :: out] Permission denied (publickey).
** fatal: The remote end hung up unexpectedly

Looks like you need to forward your Github ssh key through the ssh connection Capistrano opens to the AWS instance. Add set :ssh_options, { :forward_agent => true } to your deploy.rb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM