Capistrano:localhost上不存在链接文件database.yml

时间:2015-07-17 16:23:09

标签: ruby-on-rails vagrant capistrano

我正在部署到本地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).

1 个答案:

答案 0 :(得分:2)

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

根据bash手册页:

  

-f file如果文件存在且为常规文件,则为真。

您的database.yml是否可能是目录?或者不是"常规文件"?或者vagrant用户可能无权访问它?