From: Eric Hodel Date: 2005-10-28T14:19:55+09:00 Subject: Re: Stuck with modules/classes/inheritance On Oct 27, 2005, at 9:59 PM, Kev Jackson wrote: > Eric Hodel wrote: > >> On Oct 27, 2005, at 9:51 PM, Kev Jackson wrote: >> >>> In lib/b.rb, you need to write: >>> >>>> require "base" >>>> module A >>>> class B < Base >>>> end >>>> end >>>> >>>> otherwise your code in b.rb isn't aware of base.rb, and thus >>>> doesn't know about A::Base. >>> >>> require 'base' >> >> require 'lib/base' then > > Thanks, this fixes it - but the actual path 'lib/base' is incorrect > in the context of the file b.rb (b.rb is in the same directory as > base.rb, therefore the line should be require 'base' no?) The load path works from Dir.pwd, not the paths of the files you require. ruby -Ilib will allow things to Just Work. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04