Ruby on rails Ruby on Rails AWS Cap部署权限被拒绝

Ruby on rails Ruby on Rails AWS Cap部署权限被拒绝,ruby-on-rails,ruby-on-rails-3,git,amazon-web-services,capistrano,Ruby On Rails,Ruby On Rails 3,Git,Amazon Web Services,Capistrano,我正在尝试将应用程序部署到amazon Web服务器。我已经安装并运行了git(我已经成功推送了它。但是当我尝试进行cap部署时,我得到了“权限被拒绝” 以下是错误: servers: ["22.229.78.34"] [ubuntu@22.229.78.34] executing command ** [22.229.78.34 :: out] Cloning into '/home/ubuntu/liquid_admin/releases /2013070315333

我正在尝试将应用程序部署到amazon Web服务器。我已经安装并运行了git(我已经成功推送了它。但是当我尝试进行cap部署时,我得到了“权限被拒绝”

以下是错误:

   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
这是部署文件:

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   
或者:
accurev
bzr
cvs
darcs
git
mercurial
performance
subversion
none
也许这是一个愚蠢的提问时间,但我想知道我是否需要安装ruby和rails才能让它工作。无论如何,我现在就要这么做……但我只是想知道(不知道cap是否为你做了这件事。)

但除此之外,它为什么会失败呢

同样,git的安装和运行都很好。Push工作得很好。SSH工作得很好。我应该注意的另一件事是,我在运行时尝试了这两种方法ubuntu@22.229.78.34我只运行了22.229.78.34。我使用ubuntu的方式,因为这通常是亚马逊接受连接的唯一方式。任何帮助都将不胜感激

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

看起来您需要通过Capistrano打开的ssh连接将Github ssh密钥转发到AWS实例。将
set:ssh\u options,{:forward\u agent=>true}
添加到您的
deploy.rb

看起来一切正常……然后我听到了“bundle not found”[54.229.78.34::out]解析增量:100%(21/21),完成。**[out::54.229.78.34]sh:1:*[out::54.229.78.34]bundle:not foundNevermind…在另一篇帖子中找到了解决方案…胜利!
** [22.229.78.34 :: out] Permission denied (publickey).
** fatal: The remote end hung up unexpectedly