# Parse error, unexpected $, expecting kEND

**URL:** <https://www.ruby-forum.com/t/parse-error-unexpected-expecting-kend/101969>\
**Category:** Ruby\
**Created:** [August 8, 2006, 11:19pm UTC](https://www.ruby-forum.com/t/parse-error-unexpected-expecting-kend/101969 "2006-08-08T23:19:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@slain](https://www.ruby-forum.com/u/slain)\
**Post date:** [August 8, 2006, 11:19pm UTC](https://www.ruby-forum.com/t/parse-error-unexpected-expecting-kend/101969/1 "2006-08-08T23:19:06Z")

</div>

Does anyone have any techniques or tools that they use to help narrow  
these down in the code at all?

I mean the current method of scanning/folding the code to see if I can  
tell where the missing ‘end’ is is a nightmare lol.

Of course a working ruby code indenter might help with that but I havent  
found one of those that works either.

---

<div class="post-metadata">

**Author:** ![slain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@slain](https://www.ruby-forum.com/u/slain)\
**Post date:** [August 9, 2006, 5:37am UTC](https://www.ruby-forum.com/t/parse-error-unexpected-expecting-kend/101969/2 "2006-08-09T05:37:03Z")

</div>

Slain W. wrote:

> Does anyone have any techniques or tools that they use to help narrow  
> these down in the code at all?
> 
> I mean the current method of scanning/folding the code to see if I can  
> tell where the missing ‘end’ is is a nightmare lol.

using an editor with colorizing is a big help. Some use vim with the  
ruby syntax  
addition.  
The missing ‘end’ problem, when it is not obvious, is usually traceable  
to a  
missing ", ', or a bracket not present, or misplaced {} {] (). With  
vim, it is  
easy in command mode to place the cursor on the one bracket, and press  
“%” to identify its match.

Quite some time ago, there was one mentioned on [ruby-lang.org](http://ruby-lang.org), but I  
could not  
find it when looked. There is the beginning of a class PrettyPrint in  
current cvs ruby  
stable (1.9). I think this is for use within declared classes, and is  
not quite what I  
think you are looking for. It is not real obvious how to use that  
class.

regards,  
Gerald

---

<div class="post-metadata">

**Author:** ![slain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@slain](https://www.ruby-forum.com/u/slain)\
**Post date:** [August 10, 2006, 12:29am UTC](https://www.ruby-forum.com/t/parse-error-unexpected-expecting-kend/101969/3 "2006-08-10T00:29:38Z")

</div>

“Gerald M.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Slain W. wrote:
> 
> > Does anyone have any techniques or tools that they use to help narrow  
> > these down in the code at all?
> > 
> > I mean the current method of scanning/folding the code to see if I can  
> > tell where the missing ‘end’ is is a nightmare lol.
> 
> using an editor with colorizing is a big help.

Using an editor with intelligent indentation is of even more help.  
Then, divide and conquer.
