From: Phrogz Date: 2008-01-29T05:34:58+09:00 Subject: Re: Problem loading a YAML file On Jan 28, 1:19 pm, Keith Carter wrote: > I'm having issues loading a YAML file. Here is the YAML file (named > test.yml): > > foo: 5 > bar: some string > > Here is my Ruby: > > C:\noozler\trunk>ruby script/console > Loading development environment (Rails 2.0.2) > > >> require 'yaml' > => [] > >> File.exists?("test.yml") > => true > >> t = YAML::load("test.yml") > => "test.yml" WARNING! Right here, you see that the result of loading "test.yml" is "test.yml". It's not a Hash like you expected. Apparently YAML.load takes a raw YAML string, not a filename. Try: irb(main):004:0> y = YAML.load( IO.read( 'test.yml' ) ) => {"foo"=>5, "bar"=>"some string"}