From: Andrea Fazzi Date: 2008-01-29T19:57:32+09:00 Subject: Re: Problem loading a YAML file Try this: require 'yaml' t = YAML::load( File.open('test.yaml') ) t['bar'] Keith Carter ha scritto: > 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" > >>> t['bar'] >>> > => nil > > > I would expect t['bar'] to show: "some string". > > Any ideas? >