From: Thomas Counsell Date: 2004-11-01T18:20:59+09:00 Subject: Re: erb: undefined local variable Hello May just have been the way it arrived in my email message, but ruby code in erb has to be surrounded by <% and %>. So your sample would need to be: Eruby Example

Enumeration

Tom On 1 Nov 2004, at 09:08, Tang Hai Tuan Minh wrote: > > Hi all, > > This is my first time into the world of Ruby. I was interested in erb > and so > I copied part of a code fragment from the PickAxe book (2nd Ed.) into a > file called sample.html, ran erb over it (erb sample.html), and > received > the error message > "(erb): undefined local variable or method `i' for > main:Object(NameError)" > > The file sample.html is as follows > > > > Eruby Example > > >

Enumeration

> > > > > Now, if I ran erb with erb << ENDRB and write the above code segment > before > ENDRB then everything is fine. I had read in the PickAxe book that > this is > also similar to what you might get by using irb instead of the ruby > intepreter. However, the solution of sandwiching the code block between > begin and end doesn't help in my case. > > Can anyone please enlighten me to a solution ? It's kinda late here so > I am > too lazy too think. > > TIA, > Minh > > -- > Three minutes' thought would suffice to find this out; but thought is > irksome and three minutes is a long time. > -- A.E. Houseman > > >