Last Updated: February 25, 2016
· adrian2112

Generate database.yml for the projects where you ignore it

Where I work, we usually ignore to database.yml in the .gitignore file, so each of the people that works on the projects can has its own, but I find it annoying to clone a project and have to look for the database.yml file in other proyects, copy it and then set my database login info. (First world problem, I know :) )

Thats why I created this simple gem to create a database.yml for the rails project in your current directory.

After you install it (gem install database_yml), it is as easy as
database_yml -d postgresql and it generate the database.yml with the database driver that you specify, the database name as {yourprojectname}_development, test and production, and your username

I hope someone finds it useful

1 Response
Add your response


In Symfony2 they use Incenteev/ParameterHandler, which creates config YAML files from templates called .dist files. Basically it checks for the missing params (which is nice considering that most projects introduce more config params as they evolve) and asks for them during build process. Feel free to take a look at https://github.com/khasinski/fillparams

over 1 year ago ·