Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About Ruby error 'kEnd'?

Tags:

ruby

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?

like image 730
rlb.usa Avatar asked Mar 31 '26 23:03

rlb.usa


1 Answers

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...

like image 75
Gareth Avatar answered Apr 02 '26 14:04

Gareth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!