Capistrano: linked file database.yml does not exist on my.server.ipadress

前端 未结 2 434
长发绾君心
长发绾君心 2020-12-28 19:33

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).
ER         


        
相关标签:
2条回答
  • 2020-12-28 20:03

    As i prefer to have my files central on the deployment server, i use this task to deploy the config files from the config dir to the linked files dir on the app server.

    This uses rsync, since i use capistrano-rsync to deploy.

    namespace :deploy do
    
      task :copy_config do
        on release_roles :app do |role|
          fetch(:linked_files).each do |linked_file|
            user = role.user + "@" if role.user
            hostname = role.hostname
            linked_files(shared_path).each do |file|
              run_locally do
                execute :rsync, "config/#{file.to_s.gsub(/.*\/(.*)$/,"\\1")}", "#{user}#{hostname}:#{file.to_s.gsub(/(.*)\/[^\/]*$/, "\\1")}/"
              end
            end
          end
        end
      end
    
    end
    before "deploy:check:linked_files", "deploy:copy_config"
    
    0 讨论(0)
  • 2020-12-28 20:09

    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.

    0 讨论(0)
提交回复
热议问题