【发布时间】:2014-08-11 13:58:10
【问题描述】:
我正在尝试将我的 Rails 应用程序从 Bitbucket 部署到 Digital Ocean。我使用 Git 作为我的版本控制系统,我做了以下工作:
- 获取我的电脑 ssh 密钥
pbcopy < ~/.ssh/id_rsa.pub - 将我的电脑 ssh 密钥添加到 Digital Ocean (https://cloud.digitalocean.com/ssh_keys)
- 将我的计算机 ssh 密钥作为部署密钥添加到 Bitbucket 存储库 (
https://bitbucket.org/<account name>/<project admin/deploy-keys)
但是当我运行cap deploy 时会出现此错误
servers: [<server ip>]
[<server ip>] executing command
** [<server ip> :: out] Permission denied (publickey).
** [<server ip> :: out]
** [<server ip> :: out] fatal: Could not read from remote repository.
** [<server ip> :: out]
** [<server ip> :: out]
** [<server ip> :: out] Please make sure you have the correct access rights
** [<server ip> :: out]
** [<server ip> :: out] and the repository exists.
** [<server ip> :: out]
这是我的deploy.rb 文件
set :scm, "git"
set :repository, "git@bitbucket.org:<user name>/<project name>.git"
set :branch, "master"
如果我 clone 将 repo 发送到我的本地,它可以正常工作。我浏览了 Bitbucket 文档,但仍然无法弄清楚缺少什么。
我的 ssh 到 Bitbucket 有效:
ssh -T git@bitbucket.org
authenticated via a deploy key.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
<repor name>
找到了这个SO question,但没有任何运气。
【问题讨论】:
标签: git ruby-on-rails-4 capistrano bitbucket digital-ocean