From: Kirk Haines Date: 2004-05-31T06:02:20+09:00 Subject: Re: yaml - ruby 1.8.1 (2003-12-25) [i686-linux] On Mon, 31 May 2004 02:27:34 +0900, Paul Vudmaska wrote > Hello, > I'm trying to use yaml for the first time - i'm getting a load error > yaml/parser - it dies here in yaml.rb. > > begin > require 'yaml/syck' > @@parser = YAML::Syck::Parser > @@loader = YAML::Syck::DefaultLoader > @@emitter = YAML::Syck::Emitter > rescue LoadError > require 'yaml/parser' > @@parser = YAML::Parser > @@loader = YAML::DefaultLoader > require 'yaml/emitter' > @@emitter = YAML::Emitter > end Paul, YAML support comes with Ruby 1.8.1. All you need to do is: require 'yaml' Then you can do whatever you need. ----- begin cf = File.open configuration_file rescue Exception => e mylog.error "Ut oh. Couldn't load the configuration file: #{e}" raise end @@config = YAML::load(cf) ----- File.open('mydata','w+') {|fh| fh.print mydata.to_yaml} ----- and so on. Kirk Haines