Stefano Crocco
6/10/2008 7:56:00 AM
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. 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.
Stefano