Ask Your Question

syntax error unexpected kend expecting $end

asked 2015-01-27 07:59:27 -0600

wingZero gravatar image

updated 2015-01-27 22:09:58 -0600

GregLarkin gravatar image


I am getting this error with the below syntax, any idea what I need to do to get this working?

The ruby I believe seems ok.


<% if definition == "someserver" -%>

<% i = exec( "date +%Y_%m_%d" ) -%>

$InputFileName /data/logs/weblogs/jetty-<%= i -%>.request.log

<% end -%>

 Log anything (except mail) of level info or higher.

Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none;local7.none     /var/log/messages

<% end -%>
edit retag flag offensive close merge delete


Is that all to your code? From that error it looks like it is expecting another <% end %> statement - any other loops/ifs/etc that aren't in the above snippet?

lorcutt gravatar imagelorcutt ( 2015-01-27 11:07:02 -0600 )edit

Hi, There are things further below, but nothing above that as its at the top of the file. If I remove this bit the template runs fine.

wingZero gravatar imagewingZero ( 2015-01-27 15:23:47 -0600 )edit

It looks like you have unbalanced end statements, but it would be helpful if you posted a link to a pastebin of the complete file. Otherwise, it may be difficult to tell exactly why the error occurs.

GregLarkin gravatar imageGregLarkin ( 2015-01-27 22:14:17 -0600 )edit

Hi, Added the full file.

wingZero gravatar imagewingZero ( 2015-01-28 01:53:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-28 11:11:45 -0600

GregLarkin gravatar image

Looking at your full source code, it appears that you have an unbalanced end statement in your Ruby code. Remove the unbalanced one, and you should be all set.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-01-27 07:59:27 -0600

Seen: 894 times

Last updated: Jan 28 '15