2

I am trying to include an erb file in puppet. But the file consists of lines like these:

<%@ taglib prefix="ww" uri="webwork" %>
<%@ taglib prefix="ui" uri="webwork" %>
<%@ taglib prefix="aui" uri="webwork" %>
<%@ taglib prefix="page" uri="sitemesh-page" %>

When I run puppet, this is showing a syntax error that says
'@ ' is not allowed as an instance variable name.

How can I escape this character @?

Alex Harvey
  • 14,494
  • 5
  • 61
  • 97
Sarath S
  • 373
  • 3
  • 6
  • 17

1 Answers1

7

Your question is basically answered here already: How do I escape the ERB tag in ERB.

You can't escape the @ character per se; you need to "escape" the ERB tags, by using the sequence <%% to indicate that you want the literal string <%.

So, change your ERB code to:

<%%@ taglib prefix="ww" uri="webwork" %>
<%%@ taglib prefix="ui" uri="webwork" %>
<%%@ taglib prefix="aui" uri="webwork" %>
<%%@ taglib prefix="page" uri="sitemesh-page" %>
Alex Harvey
  • 14,494
  • 5
  • 61
  • 97