No. At some point you should insert this material, and it should be in the clear.
This is usually a problem during deployment, when you do not want anyone who has read access to the repository to see the db configuration for the deployment servers.
I worked on this with a special capistrano task that copies (or symbolizes) the .yml database from the serverβs home directory to the application. (So ββthere is an empty database.yml in my repo, and it becomes overridden whenever I publish a new version with a secret version that is already on the server)
I wrote about this here: http://www.tigraine.at/2011/09/25/securely-managing-database-yml-when-deploying-with-capistrano/
As for not sharing this in development: just put database.yml in your .gitignore and it won't be committed
source share