Capistrano:链接文件 database.yml 在 my.server.ipadress 上不存在 [英] Capistrano: linked file database.yml does not exist on my.server.ipadress
问题描述
在我尝试通过 capistrano 将我的应用程序部署到我的服务器后,我收到此错误消息:
after i try to deploy my app via capistrano to my server i get this error message:
DEBUG [605f198a] Finished in 0.084 seconds with exit status 1 (failed).
ERROR linked file /home/deploy/myrailsapp/shared/config/database.yml does not exist on xx.xxx.xx.xxx
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@xx.xxx.xx.xxx: exit
SystemExit: exit
Tasks: TOP => deploy:check:linked_files
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@xx.xxx.xx.xxx: exit
我的 deploy.rb 是:
my deploy.rb is:
set :deploy_to, '/home/deploy/myrailsapp'
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, 'deploy:restart'
after :finishing, 'deploy:cleanup'
end
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
我尝试了这个 tut https://www.gorails.com/deploy/ubuntu/14.04,这个这是我第一次尝试使用 capistrano.
i tried this tut https://www.gorails.com/deploy/ubuntu/14.04, this is my first try with capistrano.
推荐答案
只需手动创建 /home/deploy/myrailsapp/shared/config/database.yml
文件并进行调整即可.
Just create /home/deploy/myrailsapp/shared/config/database.yml
file manually and adjust it.
Capistrano 不会开箱即用地创建(或管理)配置文件.所以,你应该手动或自动化使用自己的 Capistrano
脚本、Puppet
、Chef
、Ansible
工具.
Capistrano doesn't create (or manage) configuration file out of the box. So, you should do it manually or automate use own Capistrano
scripts, Puppet
, Chef
, Ansible
tools.
这篇关于Capistrano:链接文件 database.yml 在 my.server.ipadress 上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!