On 26 Aug 2010, at 14:57, Brian Candler wrote:

> Iain Barnett wrote:
>> It turns out one of the other files in the library also had require=20=

>> 'file/fo'o etc, so some files were required twice. What I don't=20
>> understand is why this would generate warnings, as my understanding =
is=20
>> that require can be called as multiple times but will only load the=20=

>> files once. Is this incorrect?
>=20
> It can happen if you require them in different ways, e.g.
>=20
> require 'file/fo'
> require './file/fo'
> require '../lib/file/fo'
> require File.join(File.dirname(__FILE__), 'fo')
>=20
> If that's what's happening, the solution is to be consistent with your=20=

> require statements, and if necessary set up $: (aka $LOAD_PATH) =
suitably=20
> at the start of your program.
> --=20
> Posted via http://www.ruby-forum.com/.

Ah, I see. Yes, a part of the code was dynamically calling require, and =
the offending statements were static.

One more gotcha in the bag! Thanks. Nice thing about all the "gotchas" =
I've found in Ruby so far is that they may be frustrating at the time, =
but they don't kill the fun of the language.

Regards,
Iain=