From: "Eric I." Date: 2007-03-21T13:05:08+09:00 Subject: Re: Real Beginner Question - (NameError) On Mar 20, 11:49 pm, CSZ wrote: > When i execute the makeSwamp.rb file i can enter a "new idea" but than i > get: > > /makeSwamp.rb:8: undefined local variable or method `code_words' for > main:Object (NameError) > > (line 8 is: code_words.each do |real, code| ) > > Why ??? I've run kdiff and its exactly as in the tutorial... Maybe its > just to late for me.. When you require (or load) a file, the local variables are not brought in. Try changing code_words to a global variable by making it "$code_words" (in both files). Or if you think it's more appropriate, change it to a constant by making it "CodeWords" in both files. Eric Are you interested in on-site Ruby training that uses well-designed, real-world, hands-on exercises? http://LearnRuby.com