From: Gaston Garcia Date: 2005-08-19T05:12:47+09:00 Subject: Re: require question ------=_Part_9146_20104899.1124395961706 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks Brian and Why. I see why it wasn't working. And thanks for the new URL of the poignant guide. -gaston. On 8/18/05, why the lucky stiff wrote: >=20 > Gaston Garcia wrote: > > On another ruby file saved as 'my_string_reader.rb' I write: > > > > require 'my_string' > > puts 'my_string' > > > > I thought that would output my 'hello world', but I get "undefined loca= l > > variable or method 'my_string' for main:Object (NameError) > > > Gaston, welcome to Rubydom. We've proven that we can be funny, but now > you get to see how helpful we are. >=20 > This is an error in the book. You might want to read the newer version > at... >=20 > http://qa.poignantguide.net/ >=20 > ...for now. I'm working on a new design and the book has a bunch of > fixes on that site. >=20 > In the new version, you'll notice I'm storing stuff in the CODE_WORDS > constant rather than a code_words variable. Ordinary variables cannot > be loaded through a `require'. But constants can. >=20 > That's all. Nothing more. >=20 > _why >=20 >=20 --=20 -gaston ------=_Part_9146_20104899.1124395961706--