From: Tang Hai Tuan Minh Date: 2004-11-01T18:08:51+09:00 Subject: erb: undefined local variable 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