What's the easiest method to handle the Rails database.yml if multiple individuals are focusing on the project and database locations will vary (the socket particularly).

First, move database.yml to some template file.

If you are on Git:

git mv config/database.yml config/database.yml.example

git commit -m "moved database.yml for an example file"

Or, if you are on Subversion:

svn move config/database.yml config/database.yml.example

svn ci -m "moved database.yml for an example file"

Second, disregard the .yml version.

If you are on Git:

cat > .gitignore


git add .gitignore

git commit -m "overlooked database.yml"

If you are on Subversion:

svn propset svn:ignore config "database.yml"

Third, install Where's your database.yml, dude?:

script/wordpress plugin install git://github.com/technicalpickles/wheres-your-database-yml-dude

That wordpress plugin alerts designers before any Rake jobs are run when they haven't produced their very own local version of config/database.yml.

4th, setup a Capistrano deploy task:

# in RAILS_ROOT/config/deploy.rb:

after 'deploy:update_code', 'deploy:symlink_db'

namespace :deploy do

  desc "Symlinks the database.yml"

  task :symlink_db, :roles => :application do

    run "ln -nfs #/shared/config/database.yml #/config/database.yml"



Fifth, upload the server's version of database.yml:

scp config/database.yml my_server.com:/path_to_rails_application/shared/config/database.yml

You should use the svn:ignore property to avoid that file from being versioned.

Instructions here.

an answer is always to ignore(exclude) your database.yml from versioning.

it appears that you could put Code inside your database.yml (suprise :o )

Check this out for instructions

Another method that utilizes capistrano an ERb to prompt for that qualifications throughout deployment.

http://world wide web.simonecarletti.com/blog/2009/06/capistrano-and-database-yml/