Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:57:10+00:00 2026-05-31T12:57:10+00:00

When I try to deploy my app with capistrano, I’ll get this error: failed:

  • 0

When I try to deploy my app with capistrano, I’ll get this error:

failed: “sh -c ‘cp
/var/www/my_app/releases/20120313115055/config/database.staging.yml
/var/www/my_app/releases/20120313115055/config/database.yml'” on
IP_ADDR

My database.yml ie empty, database.staging.yml:

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: my_db
  pool: 15
  username: my_user_name
  password: my_pass
  host: localhost

in the /confing/deploy are files “production” “staging”

What am I missing here/where should I look for a failure? The credentials to database on the server should be right.

EDIT – here is my deploy

set :application, "my_app"
set :repository, "https://IP_ADDR/svn/my_app"

set :scm, :subversion
set :scm_username, 'my_name'
set :scm_password, 'my_pass'

default_run_options[:pty] = true

set :user, "my_name"
set :domain, 'IP_ADDR'

set :deploy_to, "/var/www/my_app"

set :use_sudo, false
set :deploy_via, :remote_cache
#set :keep_releases, 1

set :rails_env, 'production'

role :web, domain
role :app, domain
role :db,   domain, :primary => true # This is where Rails migrations will run

namespace :deploy do

    task :build_gems, :roles => :app do
        desc "Building gems"
        run "cd #{release_path} && bundle install --deployment"
    end

    task :migrations do
        desc "Migrating database"
        run "cd #{release_path} && rake db:migrate RAILS_ENV=production"
    end

    [:start, :stop].each do |t|
        desc "#{t} task is a no-op with passenger"
        task t, :roles => :app do ; end
    end

    desc "Restarting passenger with restart.txt"
    task :restart, :roles => :app, :except => { :no_release => true } do
        run "touch #{release_path}/tmp/restart.txt"
    end

    after "deploy:update_code", "deploy:build_gems", "db:copy_configuration", "config:copy", "deploy:migrations", "deploy:cleanup"
    after "deploy:update", "bluepill:copy_config", "bluepill:restart"
end

namespace :db do
    task :copy_configuration do
        run "cp #{release_path}/config/database.staging.yml #{release_path}/config/database.yml"
    end
end

namespace :config do
    task :copy do
        run "cp #{release_path}/config/config.staging.yml #{release_path}/config/config.yml"
    end
end

namespace :bluepill do
  desc "Restart bluepill process"
  task :restart, :roles => [:app] do
    run "#{release_path}/script/delayed_job stop"
    sudo "/etc/init.d/bluepill.sh restart"
  end

  #desc "Load bluepill configuration and start it"
  ##task :start, :roles => [:app] do
   # sudo "/etc/init.d/bluepill.sh start"
  #end

  desc "Prints bluepills monitored processes statuses"
  task :status, :roles => [:app] do
    sudo "bluepill status"
  end

  desc "Copy config"
  task :copy_config, :roles => [:app] do
    run "cp #{release_path}/config/bluepill/configuration.rb /srv/script/bluepill.rb"
  end
end

The problem:

cp: cannot stat `/var/www/my_app/releases/20120313144907/config/database.staging.yml': No such file or directory
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:57:11+00:00Added an answer on May 31, 2026 at 12:57 pm

    I’m not sure how to solve your problem. It looks like database.staging.yml is not being deployed, so there’s nothing for it to copy over.

    I think there’s a better workflow, though. Things like settings and database configs do not typically change between deployments, so those things can go in the shared folder of all the capistrano releases. Typically, you don’t want your database.yml to be in your repo either since it’s sensitive information. You can satisfy both of these things by excluding config/database.yml in your .gitignore.

    This requires you to do a one time set up on your servers. You need create a database.yml at your_app_path/shared/config. Shared is a sibling to current and releases.

    Your deploy.rb should have a task that symlinks the newly deployed release’s database.yml to the on in the shared directory. Like this:

    before "deploy:assets:precompile" do
      run ["ln -nfs #{shared_path}/config/settings.yml #{release_path}/config/settings.yml",
           "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml",
           "ln -fs #{shared_path}/uploads #{release_path}/uploads"
      ].join(" && ")
    end
    

    This means that your repo will contain no database.yml files. Since they are probably already in your repo. You’ll have to git rm them, commit. Add them to the .gitignore and commit that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I get this error when I do cap deploy:cold. * executing cd /var/www/myapp.no/releases/20100905130830;
I try to deploy my app and sometimes get this error: Failure [INSTALL_FAILED_CONTAINER_ERROR] I
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
I'm getting a port error when I try to deploy my app via: cap
I'm getting the following error when I try to deploy my django 1.3 app
I am getting a 500 error when I try to deploy my app to
I try to deploy a GWT application, to Google App Engine using NetBeans. I
I try to deploy my first app on heroku. I've created a gem manifest
I got a 500 Internal Sever error when I try to deploy my rails
It is the first time that I try to deploy a Rails app with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.