I'm joining a project and am a bit confused because it doesn't have a database.yml file. So when I try to run "rake db:schema:load" or "rake db:setup", I get a complaint about the missing file.
I've spent more time with Mongo than MySQL so I'm not sure if it's standard to just make your database.yml by hand or through a rake task that I'm not seeing, or if the fact that it is missing is a problem.
I guess your team intentionally exclude this file out from project due to this file contains DB's password.
You can create your own database.yml file (it's located at config/database.yml) ex.
development:
adapter: mysql
database: rails_dev
username: dev
password: devpwd
test:
adapter: mysql
database: rails_test
username: test
password: testpwd
production:
adapter: mysql
database: rails_prod
username: prod
password: prodpwd
Edit: To secure your configuration file, you could use environment variable instead e.g.
password: <%= ENV['APPNAME_PROD_PWD'] %>
This way you could store your configuration file in public area.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With