为什么capistrano 3链接文件在干运行时失败?

时间:2015-12-04 19:40:15

标签: ruby-on-rails ruby rake capistrano capistrano3

当我运行bundle exec cap production deploy:check:linked_files时,我获得了成功,但如果我添加--dry-run进行测试,那就会失败。

参见输出:

bundle exec cap production deploy:check:linked_files

DEBUG [c593caa5] Running /usr/bin/env [ -f /home/app/www/shared/config/database.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [c593caa5] Command: [ -f /home/app/www/shared/config/database.yml ]
DEBUG [c593caa5] Finished in 3.206 seconds with exit status 0 (successful).
DEBUG [9619277e] Running /usr/bin/env [ -f /home/app/www/shared/config/mongoid.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [9619277e] Command: [ -f /home/app/www/shared/config/mongoid.yml ]
DEBUG [9619277e] Finished in 0.304 seconds with exit status 0 (successful).

用--dry-run:

bundle exec cap production deploy:check:linked_files --dry-run

DEBUG [26483ac3] Running /usr/bin/env [ -f /home/app/www/shared/config/database.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [26483ac3] Command: [ -f /home/app/www/shared/config/database.yml ]
ERROR linked file /home/app/www/shared/config/database.yml does not exist on xxx.xxx.xxx.xxx

这是预料还是某种错误?

1 个答案:

答案 0 :(得分:2)

由于--dry-run在Capistrano中的运作方式,这是一个错误。在空运行期间,所有test命令都返回false。所以Capistrano认为链接文件不存在,它放弃了。

https://github.com/capistrano/capistrano/issues/1565