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

时间:2013-07-03 15:44:39

标签: ruby-on-rails ruby-on-rails-3 git amazon-web-services capistrano

我正在尝试将应用部署到亚马逊网络服务器。我已经安装并运行了git(我已经成功推动了。但是当我尝试进行上限部署时,我得到了#34;许可被拒绝"

这是错误:

   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   

或:accurevbzrcvsdarcsgitmercurialperforce,{{1 }或subversion

none

可能是一个愚蠢的时间问,但我想知道我是否需要安装ruby和rails才能使用。我现在无论如何都要去做......但我只是想知道(不知道帽子是否适合你。)

但除此之外..为什么会失败?

git再次设置并正常运行。推动效果很好。 SSH工作正常。我应该注意的另一件事是我通过运行ubuntu@22.229.78.34和刚刚运行22.229.78.34来尝试它。我用ubuntu的方式做到了,因为这通常是亚马逊接受连接的唯一方式。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

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

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