亚马逊AWS,帽部署:检查失败亚马逊、AWS

2023-09-12 23:36:49 作者:纣王情书

我试图安装部署到AWS EC2实例,使用Capistrano的。为了测试,我使用的是

I'm trying to setup deployment to an AWS EC2 instance, using capistrano. In order to test, I'm using

cap testing deploy:check

但Capistrano的失败,:

but Capistrano fails with:

    triggering load callbacks
  * 2013-03-12 15:41:27 executing `testing'
    triggering start callbacks for `deploy:check'
  * 2013-03-12 15:41:27 executing `multistage:ensure'
  * 2013-03-12 15:41:27 executing `deploy:check'
  * executing "test -d /......./releases"
    servers: ["ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"]
    connection failed for: ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com
    (NoMethodError: undefined method `each' for "publickey":String)

我用我的.pem文件进行连接,并且deploy.rb脚本如下所示:

I'm using my .pem file to connect, and the deploy.rb script looks as follows:

set :stages, %w(production testing)
set :default_stage, 'testing'
require 'capistrano/ext/multistage'

set :application, 'app_name'
set :user, 'the_user'
set :group, 'the_group'

set :scm, :git
set :repository,  "git@github.com:......./#{application}.git"
set :deploy_to, '/......./'
set :deploy_via, :remote_cache

# Authentication setup
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:auth_methods] = 'publickey'
ssh_options[:keys] = ['~/........pem']

任何想法,为什么会这样?

Any idea why this is happening?

推荐答案

尝试把你的公钥服务器上。

Try putting your public key on the server.

和删除

ssh_options [:auth_methods] ='公钥'

ssh_options[:auth_methods] = 'publickey'

ssh_options [:密钥] = ['〜/ ........ PEM']

ssh_options[:keys] = ['~/........pem']

这应该工作