DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Check That Database.yml Is Parsed Properly

07.16.2005
| 5657 views |
  • submit to reddit
        You can confirm that your database YAML file is being parsed properly with this one line shell command.

ruby -ryaml -e "File.open('config/database.yml') { |f| puts YAML.load(f).inspect }"
    

Comments

Snippets Manager replied on Mon, 2012/05/07 - 2:13pm

A little shorter version: ruby -ryaml -e "p YAML.load(File.read('config/database.yml'))" or ruby -Iconfig -renvironment -e "p ActiveRecord::Base.connection"