About the Ruby 'kEnd' error?

I have a lot of problems with Ruby after returning to him with a long break.

I get a lot of "unexpected errors" and I tracked them down to the lines below. I have no problem with a specific piece of code, but rather with 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 else could KEND lead to these errors? Does kEND seem to be used as a common "Badness on line ##" error? What can you tell me about KEND errors in general?

+3
source share
2 answers

unexpected kEND is where the keyword endfound somewhere should not be.

As a rule, you have closed too many blocks of code, or you have another syntax problem.

() , ...

+3

if (condition)
  do-one-line-thing()

if end. , , .

0

Source: https://habr.com/ru/post/1767267/


All Articles