Rails, Capistrano, Database.yml

I’ve found the easiest way to manage the config/database.yml file in a Rails + Capistrano configuration is to add the following line to your capistrano config/deploy.rb configuration file:

set :linked_files, %w{config/database.yml}

Then add config/database.yml to your .gitignore file.

After which, add your environment’s database.yml file to the appropriate location on the remote server(s):

#{deploy_to}/appname/shared/config/database.yml

Where deploy_to is the deploy_to capistrano configuration setting.

This way the configuration parameters are not stored in your repository, but they are still easily updated if needed.

ABOUT THE AUTHOR

Anthony Leon

Author has no description.

NO COMMENTS

Leave a comment

Your email is never published or shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>