我正在使用 capistrano 将我的 rails 应用程序部署到我的 ec2 服务器中,但是部署大约需要 10 分钟,并且在 95% 的情况下会在一个步骤中卡住近 9 分钟,我不知道原因......
这是日志
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote . HEAD"
command finished in 6ms
* getting (via checkout) revision 3100b6f25e4551fadaa64c11852e3839ff1eafc1 to /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840
executing locally: git clone -q . /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840 && cd /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840 && git checkout -q -b deploy 3100b6f25e4551fadaa64c11852e3839ff1eafc1
command finished in 18422ms
* Compressing /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840 to /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840.tar.gz
executing locally: tar czf 20120801082840.tar.gz 20120801082840
command finished in 2662ms
servers: ["50.112.250.177"]
** sftp upload /var/folders/nt/pr84tk8s1pqbj97l4mjz9gsm0000gn/T/20120801082840.tar.gz -> /tmp/20120801082840.tar.gz
[50.112.250.177] /tmp/20120801082840.tar.gz
因此,正如您在最后一行看到的那样,执行此 .tar.gz 需要花费太多时间……我猜它的 gzip 压缩但为什么需要太多时间?
在另一个新项目中,部署几乎需要 1 分钟或更短的时间......这个项目只有几个控制器,不应该那么慢......
*我在Mac上并部署到ubuntu