Capistrano:本地主机上不存在链接文件 database.yml

Capistrano: linked file database.yml does not exist on localhost

我正在部署到本地 VM。这是错误:

ERROR linked file /var/www/rails-devise-capistrano/shared/config/database.yml does not exist on localhost

但是,该文件确实存在:

vagrant@vagrant:/var/www/rails-devise-capistrano/shared/config$ ls
database.yml  secrets.yml

知道如何解决这个错误吗?

更新:

INFO [81d54d10] Running /usr/bin/env mkdir -p /var/www/rails-devise-capistrano/shared/config /var/www/rails-devise-capistrano/shared/config as vagrant@localhost
DEBUG [81d54d10] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.2 /usr/bin/env mkdir -p /var/www/rails-devise-capistrano/shared/config /var/www/rails-devise-capistrano/shared/config )
INFO [81d54d10] Finished in 0.042 seconds with exit status 0 (successful).
DEBUG [44d62e62] Running /usr/bin/env [ -f /var/www/rails-devise-capistrano/shared/config/database.yml ] as vagrant@localhost
DEBUG [44d62e62] Command: [ -f /var/www/rails-devise-capistrano/shared/config/database.yml ]
DEBUG [44d62e62] Finished in 0.042 seconds with exit status 1 (failed).

Capistrano 使用命令 [ -f PATH ] 来测试 database.yml 是否存在。它正在从该测试中返回非零退出状态,这就是它给您错误的原因。

根据 bash 手册页:

-f file True if file exists and is a regular file.

有没有可能你的database.yml是一个目录?或者不是"a regular file"?或者 vagrant 用户没有权限访问它?