本文介绍了Capistrano:链接的文件database.yml不存在于my.server.ipadress上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
DEBUG [605f198a]完成后,我尝试通过capistrano部署我的应用程序到我的服务器在0.084秒内,退出状态1(失败)。
错误链接的文件/home/deploy/myrailsapp/shared/config/database.yml不存在于xx.xxx.xx.xxx
(仅限于引入的任务)
帽已中止!
SSHKit :: Runner :: ExecuteError:执行为[email protected]时出现异常:exit
SystemExit:exit
任务:TOP = > deploy:check:linked_files
(通过运行任务--trace查看完整跟踪)
部署失败并显示错误:执行为[email protected]时出现异常:exit
我的deploy.rb是:
set:deploy_to,'/ home / deploy / myrailsapp'
pre>
set:linked_files,%w {config / database.yml}
set:linked_dirs,%w {bin log tmp / pids tmp / cache tmp / sockets vendor / bundle public / system}
命名空间:deploy do
desc'重新启动应用程序'
任务:重新启动$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
$ b end
after:publishing,'deploy:restart'
after:finish,'deploy:cleanup'
end
命名空间:deploy do
after:restart,:clear_cache do
on roles(:web),in::groups,limit:3,wait:10 do
#这里我们可以做任何事情,如:
#内se_path do
#execute:rake,'cache:clear'
#end
end
end
end
我试过这个tut ,这是我第一次使用capistrano。
解决方案只需创建
/home/deploy/myrailsapp/shared/config/database.yml
文件手动调整。
Capistrano不会立即创建(或管理)配置文件。所以,你应该手动或自动使用自己的
Capistrano
脚本,Puppet
,Chef
,可复制
工具。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 [email protected]: 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 [email protected]: exit
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
i tried this tut https://www.gorails.com/deploy/ubuntu/14.04, this is my first try with capistrano.
解决方案Just create
/home/deploy/myrailsapp/shared/config/database.yml
file manually and adjust it.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上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!