gpt4 book ai didi

ruby-on-rails - Capistrano:my.server.ip 地址上不存在链接文件database.yml

转载 作者:行者123 更新时间:2023-12-03 01:12:41 24 4
gpt4 key购买 nike

在我尝试通过 capistrano 将应用程序部署到我的服务器后,我收到此错误消息:

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是:

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

我试过这个图https://www.gorails.com/deploy/ubuntu/14.04 ,这是我第一次尝试使用 capistrano。

最佳答案

只需手动创建 /home/deploy/myrailsapp/shared/config/database.yml 文件并进行调整。

Capistrano 不会立即创建(或管理)配置文件。因此,您应该手动执行此操作或使用自己的 Capistrano 脚本、Puppet、Chef、Ansible 工具自动执行此操作。

关于ruby-on-rails - Capistrano:my.server.ip 地址上不存在链接文件database.yml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28981897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com