First move database.yml to the template file.
If you are on Git:
git mv config/database.yml config/database.yml.example git commit -m "moved database.yml to an example file"
Or if you are in Subversion:
svn move config/database.yml config/database.yml.example svn ci -m "moved database.yml to an example file"
Second, ignore the .yml version.
If you are on Git:
cat > .gitignore config/database.yml git add .gitignore git commit -m "ignored database.yml"
If you are in Subversion:
svn propset svn:ignore config "database.yml"
script/plugin install git:
This plugin warns developers before starting any Rake tasks if they have not created their own local version of config/database.yml .
Fourth, configure the Capistrano deployment 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 => :app do run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" end end
Fifth, download the database.yml server version:
scp config/database.yml user@my_server.com:/path_to_rails_app/shared/config/database.yml
James A. Rosen Sep 20 '09 at 2:17 2009-09-20 02:17
source share