2014-10-09 87 views
0

我知道這個問題已經被問了很多次了,但我無法得到它排序(我是一個初學者)。Capistrano「Permission denied(publickey)」。錯誤消息

我想要做的是將我的rails應用程序部署到使用capistrano的生產服務器上。我將我的項目存儲在gitlab上的一個目錄中。在我將應用程序移到其他gitlab存儲庫([email protected]:myusername/xxxxxx.git)之前,所有工作都很完美。

我想我也相應成立了我的deploy.rb文件:

set :application, "xxxxxx" 
set :user, "yyyyy" 
set :repository, "[email protected]:myusername/xxxxxx.git" 

但是,當我嘗試部署它,我得到的權限錯誤:

[xxxxxx.com] executing command 
[xxxxxx.com] env PATH=/home/kar/.rbenv/shims:/home/kar/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin sh -c 'if [ -d /var/www/xxxxxx/shared/cached-copy ]; then cd /var/www/xxxxxx/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 97ff4f45240a680c1d278325d7ac1871536c8091 && git clean -q -d -x -f; else git clone -q [email protected]:myusername/xxxxxx.git /var/www/xxxxxx/shared/cached-copy && cd /var/www/xxxxxx/shared/cached-copy && git checkout -q -b deploy 97ff4f45240a680c1d278325d7ac1871536c8091; fi' 
** [xxxxxx.com :: err] Permission denied (publickey). 
** [xxxxxx.com :: err] fatal: The remote end hung up unexpectedly 

可否請你建議我一些進行測試以找出問題出在哪裏? 有什麼關鍵要添加在我的服務器上?

非常感謝您的幫助。

+0

有什麼建議嗎? – 2014-10-11 17:33:56

回答

0

這裏的capistrano 3插件是專門爲解決像這樣的問題而創建的:capistrano-ssh-doctor

該插件輸出一個包含發現問題的報告並提出下一步的建議。

+0

嘗試此操作前是否有快速檢查?正如我所說我有點新,不想通過添加一個新的寶石搞亂一切 – 2014-10-09 22:23:55

+0

而我正在使用capistrano 2 – 2014-10-09 22:24:29

相關問題