ruby-on-rails - Capistrano 和 Rails 部署,无法从 ubuntu 服务器访问 bitbucket 存储库

标签 ruby-on-rails git ubuntu ssh capistrano3

我有一个可以成功部署 Rails 项目的 Ubuntu 服务器。我创建了一个新项目,并希望将其部署到同一台服务器。但是我在访问 Capistrano 部署期间存储代码的 bitbucket 存储库时遇到问题。

DEBUG [60fbbd0f] Command: /usr/bin/env chmod +x /tmp/<project_name>/git-ssh.sh
INFO [60fbbd0f] Finished in 0.098 seconds with exit status 0 (successful).
INFO [b7870f98] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:rmac/<project_name>.git as www-data@88.xxx.xxx.xxx
DEBUG [b7870f98] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/<project_name>/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.org:rmac/<project_name>.git )
DEBUG [b7870f98]    conq: repository does not exist.
DEBUG [b7870f98]    fatal: Could not read from remote repository.
DEBUG [b7870f98]    
DEBUG [b7870f98]    Please make sure you have the correct access rights
DEBUG [b7870f98]    and the repository exists. 

我试过这个

SSHKit::Runner::ExecuteError

和其他答案,但无济于事。我检查了我的服务器进程并且 ssh 代理正在运行。我很难理解看到我的其他项目部署到服务器没有问题。我使用的是同一台机器,相同的部署 key ,相同的 bitbucket 帐户。

有任何想法吗?

谢谢

最佳答案

(在聊天中找到答案)

由于正在使用 ssh-agent,请使用 ssh -A destination_servergit clone确认 ssh-agent 正在工作。

由于正在部署另一个项目,请确认 Bitbucket 存储库 URL 正确。 (这最终成为答案)

关于ruby-on-rails - Capistrano 和 Rails 部署,无法从 ubuntu 服务器访问 bitbucket 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37410153/

相关文章:

ruby-on-rails - javascript_include_tag Rails 4在生产中生成 “/javascripts/”而不是 “/assets”

git - 如何查看特定日期的所有提交?

git - 按名称找到交换文件

git - 您的配置指定与远程的引用 'refs/heads/master' merge ,但未获取此类引用。 git 远程设置 url 之后

ruby-on-rails - 如何解决 importmap 引导权限被拒绝的问题?

mysql - rails 4 : how to use UNIX_TIMESTAMP with group YEAR

ruby-on-rails - Ruby:找到更改全局变量的位置

ruby-on-rails - 类型错误 : superclass mismatch for class Task

linux - 应用修改后的Ubuntu程序源代码

git - 如何使用 Ubuntu (systemd)、Github 和 SSH key 在启动时从 git 中提取