2013-03-12 89 views
0

我試圖使用capistrano將部署安裝到AWS EC2實例。爲了測試,我使用Amazon AWS,cap部署:檢查失敗

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, "[email protected]:......./#{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'] 

任何想法爲什麼會發生這種情況?

回答

0

嘗試將您的公鑰放在服務器上。

和刪除

ssh_options [:auth_methods] = '公鑰'

ssh_options [:鍵] = [ '〜/ ........ PEM']

它應該工作

0

我最近升級了一個開發服務器,看到了相同的行爲。該錯誤消息看起來好像Capistrano正在期待一個迭代,並且publicKey的賦值沒有如此定義。

微不足道,因爲它聽起來,嘗試改變:

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

到:

set :ssh_options, {:auth_methods => "publickey"} 
set :ssh_options, {:keys => ["~/......pem"]} 

您可能需要做其他項目一樣在您的身份驗證設置。祝你好運。

0

刪除線

ssh_options[:auth_methods] = 'publickey'