我正在尝试使用capistrano设置到AWS EC2实例的部署。为了测试,我使用
cap testing deploy:check但Capistrano失败了,原因是:
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脚本如下所示:
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']你知道为什么会发生这种事吗?
发布于 2013-03-12 22:00:21
尝试将您的公钥放在服务器上。
并删除
ssh_options:auth_methods =‘公钥’
ssh_options:keys =‘~/.......pem’
它应该是可行的
发布于 2013-03-13 08:59:24
我最近升级了一个开发服务器,看到了同样的行为。错误消息看起来像是Capistrano需要一个迭代器,而publicKey的赋值并没有这样定义它。
尽管这听起来很微不足道,但试着改变:
ssh_options[:auth_methods] = 'publickey'
ssh_options[:keys] = ['~/........pem']至:
set :ssh_options, {:auth_methods => "publickey"}
set :ssh_options, {:keys => ["~/......pem"]}您可能需要对身份验证设置中的其他项目执行相同的操作。祝好运。
发布于 2013-03-13 13:41:25
删除行
ssh_options[:auth_methods] = 'publickey'https://stackoverflow.com/questions/15363003
复制相似问题