【问题标题】:Cap Deploy fails from new client machineCap Deploy 在新客户端机器上失败
【发布时间】:2023-12-23 18:11:01
【问题描述】:

我有一个运行了大约 9 个月的 Ruby On Rails 应用程序。生产环境是使用 Apache 和 Passenger 的 Ubuntu 服务器。 我使用 Capistrano 进行部署,并且使用我的 Git 存储库运行良好。 我刚刚更改了开发机器,现在当我尝试部署时出现超时错误。我不确定错误在哪里,但我觉得这可能是某种安全性。 我的开发机器是 ubuntu 12.04 桌面。 'cap deploy' 的终端输出如下:

 * executing `deploy`
 * executing `deploy:update`
** transaction: start
* executing `deploy:update_code`
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:nicko777/Tata.git HEAD"
command finished in 4260ms
* executing "if [ -d /home/passenger/Tata/shared/cached-copy ]; then cd /home/passenger/Tata/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 34350075132fff5c0bd8a831667680f6c912ef23 && git clean -q -d -x -f; else git clone -q git@github.com:nicko777/Tata.git /home/passenger/Tata/shared/cached-copy && cd /home/passenger/Tata/shared/cached-copy && git checkout -q -b deploy 34350075132fff5c0bd8a831667680f6c912ef23; fi"
servers: ["10.1.1.21"]
Password: 
[10.1.1.21] executing command
 ** [10.1.1.21 :: out] Write failed: Broken pipe
 ** fatal: The remote end hung up unexpectedly
command finished in 1033137ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/passenger/Tata/releases/20120626103643; true"
servers: ["10.1.1.21"]
[10.1.1.21] executing command
command finished in 16ms
failed: "sh -c 'if [ -d /home/passenger/Tata/shared/cached-copy ]; then cd /home/passenger/Tata/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 34350075132fff5c0bd8a831667680f6c912ef23 && git clean -q -d -x -f; else git clone -q git@github.com:nicko777/Tata.git /home/passenger/Tata/shared/cached-copy && cd /home/passenger/Tata/shared/cached-copy && git checkout -q -b deploy 34350075132fff5c0bd8a831667680f6c912ef23; fi'" on 10.1.1.21

【问题讨论】:

    标签: ruby-on-rails ubuntu capistrano


    【解决方案1】:

    找出问题所在。当我创建新机器时,它将 Capistrano 升级到版本 2.12.0,我检查了服务器,它的版本是 2.9.0。 我将新机器上的版本降级到 2.9.0,现在 cap deploy 可以正常工作了。

    【讨论】: