ruby-on-rails - 在使用 capistrano 进行 rails 部署期间无法识别 git 存储库

标签 ruby-on-rails git deployment capistrano

我试图找出为什么在我尝试部署我的 Rails 应用程序时从我的远程 git 存储库中收到错误。它告诉我它不是 git 存储库,但我可以毫无问题地从中推送和 pull 。但是,我最近遇到了 bash 找不到 git 的问题,但这只是我安装 macports 时突然出现的路径变量问题(我认为)。现在已经修好了。在此先感谢您提供的任何帮助! 错误输出如下:

my-MacBook-Pro:project myUser$ cap deploy:update
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@server.example.ca/usr/local/git_root/project.git master"
fatal: 'git@server.example.ca/usr/local/git_root/project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
  * executing "rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true"
    servers: ["project.example.ca"]
    [project.example.ca] executing command
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290@project' -c 'rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true'
    command finished in 639ms
Command git ls-remote git@server.example.ca/usr/local/git_root/project.git master returned status code pid 1815 exit 128

最佳答案

看起来你的 Git URL 格式不正确:

git ls-remote git@server.example.ca/usr/local/git_root/project.git master

应该是:

git ls-remote git@server.example.ca:/usr/local/git_root/project.git master

它们遵循 SCP 协议(protocol)(​​更多信息请参见 git-clone 联机帮助页)。

关于ruby-on-rails - 在使用 capistrano 进行 rails 部署期间无法识别 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10000489/

相关文章:

ruby-on-rails - Rails 不尊重 has_one 的模型关联

ruby-on-rails - Rails 4 部分与集合

ruby-on-rails - Where 子句按 "ANY"过滤 - 这是什么意思?

node.js - 如何使用 Visual Studio Code 将 Node.js 机器人部署到 Azure?

docker - 设置.travis.yml以自动部署Docker镜像

ruby-on-rails - 使用 JS 响应 iframe 文件上传

Android源码git下载错误

Git:使用还原或 checkout 来撤消推送的更改?

git tfs : How to rcheckin git commits when there is another checkin in tfs?

python - Celery Django 部署因 Elastic Beanstalk 失败,原因是 ImportError:无法导入名称 'Celery' (ElasticBeanstalk::ExternalInitationError)