From: Christophe Grandsire Date: 2005-10-28T13:48:45+09:00 Subject: Re: Stuck with modules/classes/inheritance Selon Kev Jackson : > given: > > test.rb : > > require 'b' > > b = B.new > > > lib/base.rb: > > module A > class Base > end > end > > lib/b.rb: > > module A > class B < Base > end > end > > > Why do I get > > ./lib/b.rb:2: uninitialized constant A::Base (NameError) > from test.rb:1:in `require' > from test.rb:1 > > ? > 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. -- Christophe Grandsire. http://rainbow.conlang.free.fr You need a straight mind to invent a twisted conlang.