From: Rich Kilmer Date: 2002-01-29T10:10:56+09:00 Subject: RE: require problem - uninitialized constant Set (NameError) To load the set.rb file: require "set" # note the quotes Hal's Set class is in the Sets module (which is a Ruby namespace) so to create a new set either do: include Sets # includes the Sets namespace s = Set.new or don't do the include: s = Sets::Set.new or, because Hal wrote a method named "Set" on the Sets module you can do: s = Sets.Set #which generates a Sets::Set object...see source -rich > -----Original Message----- > From: David Corbin [mailto:dcorbin@imperitek.com] > Sent: Monday, January 28, 2002 6:54 PM > To: ruby-talk ML > Subject: require problem - uninitialized constant Set (NameError) > > > I took the ruby code here (http://www.hypermetrics.com/rubyset.html) and > created a file "set.rb" in "/usr/local/lib/ruby/site_ruby". > > I then do a "require set" in my code. > > When I attempt to initialize something with "Set.new", I get > "uninitialized constant Set (NameError)" > > "ruby -e 'puts $:'" yields > > /usr/local/lib/ruby/site_ruby/1.6 > /usr/local/lib/ruby/site_ruby/1.6/i686-linux > /usr/local/lib/ruby/site_ruby > /usr/local/lib/ruby/1.6 > /usr/local/lib/ruby/1.6/i686-linux > > I've dug around and come up empty. What am I doing wrong? > > Thanks > David > > >