I'm having a lot of trouble with Ruby after coming back to it from a long break.
I'm getting a lot of 'unexpected kEND' errors, and I've tracked it down to lines below. I'm not having trouble with a particular piece of code, but rather, the concept of 'unexpected kEND' .
if (condition)
do-one-line-thing()
and
# inside of a loop...
if ( condition-evaluation-that-might-cause-error-during-run-time )
do-something()
end
and
myarray.each { |element|
do-soemthing-that-might-cause-error-during-run-time-for-some-but-not-all-values()
}
Question :
What other things can cause these kEND errors ? It seems like kEND is being used as a general "Badness on line ##" error? What can you tell me about kEND errors in general?
an unexpected kEND is where the end keyword was found somewhere it shouldn't be.
Generally you've closed too many code blocks, or you've got some other syntax problem.
If you paste a (complete) file which has this problem we can point out the error...
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