From: Charlie Marx Date: 2009-01-04T03:32:00+09:00 Subject: Re: Ruby 1.8.7: ERB is broken Actually comments will work in 1.8.7, but only with a specific, more limited syntax than shown in the original example above. Here is a relevant portion from the inline documentation for ERB: | ERB recognizes certain tags in the provided template and converts them based on the rules below: | | <% Ruby code -- inline with output %> | <%= Ruby expression -- replace with result %> | <%# comment -- ignored -- useful in testing %> | % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new) | %% replaced with % if first thing on a line and % processing is used | <%% or %%> -- replace with <% or %> respectively So comments ARE allowed when the whole embedded expression is a comment, i.e.: <%# this is good comment %> <% n=1 # this is a bad comment %> If your 'bad comments' are consistent in their usage of whitespace around the hash mark, then it ought to be easy to do a grep search-and-replace to change all your bad comments to look like this, which WILL work in Ruby 1.8.7: <% n=1 %><%# this is the fixed comment %> -- Posted via http://www.ruby-forum.com/.