Capistrano"许可被拒绝(公钥)。"错误信息

时间:2014-10-09 19:54:06

标签: ruby-on-rails-3 capistrano gitlab

我知道这个问题已被多次询问,但我无法对其进行排序(我是初学者)。

我尝试做的是使用capistrano将我的rails应用程序部署到我的生产服务器。我将项目存储在gitlab上的一个目录中。在我将应用程序移到另一个gitlab存储库(git@gitlab.com:myusername / xxxxxx.git)之前,一切都运行良好。

我认为我相应地设置了deploy.rb文件:

set :application, "xxxxxx"
set :user, "yyyyy"
set :repository,  "git@gitlab.com: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 git@gitlab.com: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

您能否请一些测试来找出问题出在哪里? 我的服务器上有没有要添加的密钥?

非常感谢你的帮助。

1 个答案:

答案 0 :(得分:0)

这是capistrano 3插件,专门用于解决像这样的问题:capistrano-ssh-doctor

该插件会输出包含已发现问题的报告,并建议后续步骤。