From: Josh Cheek Date: 2010-09-27T08:36:59+09:00 Subject: Re: Help! Undefined local variable --001485f626d48790450491321561 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Sep 26, 2010 at 4:53 PM, Anthony Ob wrote: > Markus Fischer wrote: > > Anthony, > > > > On 26.09.2010 23:32, Anthony Ob wrote: > >> def mtf(arg1="Dibya", arg2="Shashank", arg3="shashank") > > > > You miss-typed here: should be "mtd". > > > >> "#{arg1}, #{arg2}, #{arg3}." > >> end > >> puts mtd > >> puts mtd("ruby") > > > > > > - Markus > > Haha, thank you! > -- > Posted via http://www.ruby-forum.com/. > > The error is telling you that. You asked it to call the method mtd, it says "undefined local variable or method 'mtd'" but you know it exists right there, since you just wrote it. So you should be asking yourself why it can't find the method that you can see. Misspelled names are the most common cause of this. Second most common is probably accidentally defining an instance method instead of a class method. Try to pay attention when things like this happen. See what it says, think about why it says that and what could be the causes. Take note of the solution. After a while, this will help you develop an intuition for resolving issues like this. --001485f626d48790450491321561--