Skip to content

Instantly share code, notes, and snippets.

@mkocher
Created May 12, 2011 21:05
Show Gist options
  • Save mkocher/969445 to your computer and use it in GitHub Desktop.
Save mkocher/969445 to your computer and use it in GitHub Desktop.
Requring psych before yaml, ruby-1.9.2-p180 on centos
ruby-1.9.2-p180 :006 > exit
[clients-user@ip-10-83-118-38 workspace]$ cd ..
[clients-user@ip-10-83-118-38 workspace]$ vi config
config/ config.ru
[clients-user@ip-10-83-118-38 workspace]$ vi config/
application.rb cucumber.yml database.yml.example environments/ locales/
boot.rb database.yml environment.rb initializers/ routes.rb
[clients-user@ip-10-83-118-38 workspace]$ vi config/database.yml.example
[clients-user@ip-10-83-118-38 workspace]$ irb
ruby-1.9.2-p180 :001 > require 'pp'
=> true
ruby-1.9.2-p180 :002 > require 'psych'
=> true
ruby-1.9.2-p180 :003 > require 'yaml'
=> true
ruby-1.9.2-p180 :004 > pp YAML.load_file('config/database.yml.example')
{"common"=>
{"adapter"=>"postgresql",
"username"=>"postgres",
"password"=>"password",
"host"=>"localhost"},
"development"=>
{"adapter"=>"postgresql",
"username"=>"postgres",
"password"=>"password",
"host"=>"localhost"}}
=> {"common"=>{"adapter"=>"postgresql", "username"=>"postgres", "password"=>"password", "host"=>"localhost"}, "development"=>{"adapter"=>"postgresql", "username"=>"postgres", "password"=>"password", "host"=>"localhost"}}
ruby-1.9.2-p180 :005 > exit
[clients-user@ip-10-83-118-38 workspace]$ irb
ruby-1.9.2-p180 :001 > require 'pp'
=> true
ruby-1.9.2-p180 :002 > require 'yaml'
=> true
ruby-1.9.2-p180 :003 > require 'psych'
=> true
ruby-1.9.2-p180 :004 > pp YAML.load_file('config/database.yml.example')
{"common"=>
{"adapter"=>"postgresql",
"username"=>"postgres",
"password"=>"password",
"host"=>"localhost"},
"development"=>
{"adapter"=>"postgresql",
"username"=>"postgres",
"password"=>"password",
"host"=>"localhost",
"database"=>"foo_dev"}}
=> {"common"=>{"adapter"=>"postgresql", "username"=>"postgres", "password"=>"password", "host"=>"localhost"}, "development"=>{"adapter"=>"postgresql", "username"=>"postgres", "password"=>"password", "host"=>"localhost", "database"=>"foo_dev"}}
@mkocher
Copy link
Author

mkocher commented May 12, 2011

the database key gets overwritten. something broke yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment