2013-02-24 75 views
0

我已經耗盡自己和我的資源,試圖重新創造上週我必須創造的奇蹟。EC2 Ubuntu Capistrano問題(NoMethodError:未定義方法`每個'for「publickey」:字符串)

我正在使用運行Ubuntu 12.10 x64的EC2微型實例爲使用Jenkins和Capistrano的CI創建測試服務器。

我能夠「弄清楚」我上週做了些什麼,並且似乎有一臺服務器正在工作,但發現自己無法重新建立連接到我的EC2實例,以將代碼從github推送到所述實例。

這裏是我所得到的,當我神符 「上限部署」:

[email protected]:/var/www/config$ cap deploy 

* 2013年2月24日11時05分11秒執行deploy' * 2013-02-24 11:05:11 executing部署:更新」 **交易:開始 * 2013 -02-24 11:05:11執行deploy:update_code' executing locally: "git ls-remote [email protected]:example/example.git master" command finished in 1871ms * executing "git clone -q [email protected]:example/example.git /var/www/example/releases/20130224110513 && cd /var/www/example/releases/20130224110513 && git checkout -q -b deploy de26b44bba59e1aa04dc3cf9dbec9dc4d9e4bdf3 && (echo de26b44bba59e1aa04dc3cf9dbec9dc4d9e4bdf3 > /var/www/example/releases/20130224110513/REVISION)" servers: ["example.us-west-1.compute.amazonaws.com"] *** [deploy:update_code] rolling back * executing "rm -rf /var/www/example/releases/20130224110513; true" servers: ["example.us-west-1.compute.amazonaws.com"] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: example.us-west-1.compute.amazonaws.com (NoMethodError: undefined method each'for「publickey」:String) 連接失敗:example.us-west-1.compute.amazonaws.com(NoMethodError:未定義方法`each'for「publickey」 :String)

這是我的deploy.rb文件:

set :app_name, "example" 
set :location, "example" 
set :application, "example" 
set :repository, "[email protected]:example/example.git" 
set :user, "jenkins" 
set :runner, "jenkins" 
set :branch, "master" 
set :port, 22 
set :deploy_to, "/var/www/#{application}" 
set :scm, "git" 

ssh_options[:forward_agent] = true 
ssh_options[:auth_methods] = "publickey" 
ssh_options[:keys] = ["/var/www/jenkins"] 
#set :default_stage, "dev" 

role :app, "example.us-west-1.compute.amazonaws.com", :primary => true 

我需要說明,我已經跟着其他幾個論壇和instructionals,關鍵我生成一個名爲「詹金斯」確實允許我連接到服務器,在/ var/lib中/詹金斯工作 - 這使得這個更令人困惑。

我使用的用戶詹金斯,因爲我得到了它在我的另一臺服務器上工作/它似乎會保持事情簡單與詹金斯一起使用。我對此很陌生,我一定在努力學習,我已經閱讀了幾篇文章,觀看了幾個視頻,並且非常沮喪,坦率地說,很累。有人可以幫我嗎?

+0

嗯,這個沒有答案,我有同樣的問題! – 2013-03-12 13:40:31

回答

3

我有一個安裝程序,升級後上周開始顯示相同的行爲。 (Looks like this has happened to a couple of us recently。)

錯誤似乎表明[:auth_methods]沒有以使其可迭代的方式分配。

嘗試改變:

ssh_options[:auth_methods] = "publickey" 
ssh_options[:keys] = ["/var/www/jenkins"] 

這樣:

set :ssh_options, {:auth_methods => "publickey"} 
set :ssh_options, {:keys => ["/var/www/your_actual_key_file.pem"]} 
+0

它最終成爲一個SSH認證問題(我在這篇文章後幾天就想出了 - 這是一場噩夢)。謝謝! – user2104314 2013-03-23 00:49:43

+0

感謝這幫助我與capistrano 2.15.4 – bigtallbill 2013-11-20 18:06:41

+1

謝謝,這是令人沮喪的! – Lea 2013-12-19 21:37:36

相關問題