In Ruby on Rails, 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 ?
The kEND constant refers to the token "end", as in what you end every code block with. An ensure block is the equivalent of a finally block in other languages.
begin
1/0
rescue ZeroDivisionError
puts "OH SHI-"
ensure # <- THIS THING
1/1
puts "Whew, we're safe"
end
That's what kENSURE refers to.
It sounds like you forgot to put the closing paren at the end of either a method call or a method parameter list.
I had the same issue. I had <%= end %>
instead of <% end %>
. Thanks John!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With