我有一个可以成功部署 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_server
和 git clone
确认 ssh-agent 正在工作。
由于正在部署另一个项目,请确认 Bitbucket 存储库 URL 正确。 (这最终成为答案)
关于ruby-on-rails - Capistrano 和 Rails 部署,无法从 ubuntu 服务器访问 bitbucket 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37410153/