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

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

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


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

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