Kirk Haines wrote: >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 > > > > That is what I thot, but... [webmaster@iis webmaster]$ ruby -v ruby 1.8.1 (2003-12-25) [i686-linux] [webmaster@iis webmaster]$ ruby -e "p require('yaml')" /usr/local/lib/ruby/1.8/yaml.rb:17:in `require': No such file to load -- yaml/parser (LoadError) from /usr/local/lib/ruby/1.8/yaml.rb:17 from -e:1:in `require' from -e:1 > > 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 Looking at the source of yaml.rb (part of it above) points to yaml/parser, which is phyisically not there in the file system. This is on the box which I've had multiple issues with and which i did not install the sw. This is the same place i could not get mysql-ruby to fly. This is my new host... ruby 1.8.1 (2003-12-25) [i686-linux] [root@u15154846 root]# ruby -e "p require('yaml')" true Perhaps that is why so much problem was had getting mysql-ruby to work but who knows. i'll be glad to get out of there in any case.