what is kENSURE and kEND in error message?

3 views
Skip to first unread message

SpringFlowers AutumnMoon

unread,
May 24, 2009, 3:30:11 PM5/24/09
to rubyonra...@googlegroups.com
I sometimes get an error on the page as:

compile error
/Users/jian/ror/shov2/app/views/stories/index.html.erb:13: syntax
error, unexpected kENSURE, expecting ')'
/Users/jian/ror/shov2/app/views/stories/index.html.erb:15: syntax
error, unexpected kEND, expecting ')'

the kEND, i can guess that it is End... so it means End of file but
unexpected, there should be a ')'.

how about the kENSURE ? and... why the "k" attached in front? thanks.
--
Posted via http://www.ruby-forum.com/.

Roderick van Domburg

unread,
May 24, 2009, 4:33:59 PM5/24/09
to rubyonra...@googlegroups.com
SpringFlowers AutumnMoon wrote:
> how about the kENSURE ? and... why the "k" attached in front? thanks.

K is for keyword; the keyword ensure. It seems like you have a
ensure..end block without the appropriate "begin".

--
Roderick van Domburg
http://www.nedforce.com

SpringFlowers AutumnMoon

unread,
May 24, 2009, 4:50:18 PM5/24/09
to rubyonra...@googlegroups.com
Roderick van Domburg wrote:
> SpringFlowers AutumnMoon wrote:
>> how about the kENSURE ? and... why the "k" attached in front? thanks.
>
> K is for keyword; the keyword ensure. It seems like you have a
> ensure..end block without the appropriate "begin".

ah, it actually happened with the <%= # some code %>

Colin Law

unread,
May 24, 2009, 4:55:00 PM5/24/09
to rubyonra...@googlegroups.com
I think the problem is that seen with most languages, when you have a syntax error the message may appear to have little to do with the actual error as the parser has gone off down the wrong track but does not realise this until it is too late.  Admittedly ruby does seem particularly poor at generating useful messages.

Colin

2009/5/24 SpringFlowers AutumnMoon <rails-mai...@andreas-s.net>
Reply all
Reply to author
Forward
0 new messages