> 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 

Unfortunately, Amazon haven't dispatched mine yet, so I can't see exactly the
example you are copying.

erb suffers from poor documentation. One way to make your example work is
by using a different syntax:

<html>
    <head>
        <title> Eruby Example </title>
    </head>
    <body>
        <h1> Enumeration </h1>
        <ul>
            <% 5.times do |i| %>
              <li><%=i%></li>
            <% end %>
        </ul>
    </body>
</html>

However, the source of erb.rb is there to be hacked... poking around, it
looks like you must put the percent as the *first* character of the line. So
your code works if you remove the spaces at the front of those lines:

<html>
    <head>
        <title> Eruby Example </title>
    </head>
    <body>
        <h1> Enumeration </h1>
        <ul>
% 5.times do |i|
              <li><%=i%></li>
% end
        </ul>
    </body>
</html>

Whether it's supposed to be possible to have the percent further indented, I
cannot tell. The erb.rb code is completely uncommented; there are a bunch of
things like 'trim modes' but I cannot work out what they are supposed to do.

Regards,

Brian.