From: Rick DeNatale Date: 2008-06-10T21:09:28+09:00 Subject: Re: yaml issues ------=_Part_34293_156896.1213099774655 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jun 10, 2008 at 3:55 AM, Stefano Crocco wrote: > On Tuesday 10 June 2008, jonty wrote: > > If you require a file in IRB it will output 'true' if it is there > > > > Therefore there is a problem with your installation > > Not exactly. The line > > require 'something' > > returns true only if the file something.rb (or something.so or > something.dll > if it is a C extension) has been loaded. Actually, it returns true if this invocation of require caused the file to be loaded. The phrase "has been loaded" could be interpreted to mean "has been loaded during or prior to this call" which is not the right sense. > If that file has already been loaded, > it won't be loaded again and require will return false. For example: > > irb(main):001:0> require 'yaml' > => true > irb(main):002:0> require 'yaml' > => false > > The first time, yaml.rb is indeed loaded, and require returns true. The > second > time, instead, require notices yaml.rb is already there (in particular, it > looks in the $" global variable), doesn't reload it and returns false. And, to the original issue, if the file can't be found, require won't return anything, it will raise a LoadError exception. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ ------=_Part_34293_156896.1213099774655--