简体   繁体   English

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

[英]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" 我已经安装了git并正常运行(我已经成功地进行了推送。但是当我尝试进行cap部署时,我得到“权限被拒绝”

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 或: accurevbzrcvsdarcsgitmercurialperforcesubversionnone

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. 再次设置git并运行良好。 Push worked just great. 推效果很好。 SSH is working fine. SSH工作正常。 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. 我还要注意的另一件事是,我在运行ubuntu@22.229.78.34和仅运行22.229.78.34时都进行了尝试。 I did it the ubuntu way because that's usually the only way amazon will accept a connection. 我是用ubuntu方式完成的,因为这通常是亚马逊接受连接的唯一方式。 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. 看起来您需要通过Capistrano打开到AWS实例的ssh连接转发Github ssh密钥。 Add set :ssh_options, { :forward_agent => true } to your deploy.rb set :ssh_options, { :forward_agent => true }到您的deploy.rb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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