# Parse error, unexpected $, expecting kEND

**URL:** <https://rubytalk.org/t/parse-error-unexpected-expecting-kend/29775>\
**Category:** ruby-talk\
**Created:** [8 August 2006 21:19 UTC](https://rubytalk.org/t/parse-error-unexpected-expecting-kend/29775 "2006-08-08T21:19:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slain\_Wilde](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Slain\_Wilde](https://rubytalk.org/u/Slain_Wilde)\
**Post date:** [8 August 2006 21:19 UTC](https://rubytalk.org/t/parse-error-unexpected-expecting-kend/29775/1 "2006-08-08T21:19:08Z")

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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Gerald\_Murray](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@Gerald\_Murray](https://rubytalk.org/u/Gerald_Murray)\
**Post date:** [9 August 2006 03:35 UTC](https://rubytalk.org/t/parse-error-unexpected-expecting-kend/29775/2 "2006-08-09T03:35:06Z")

</div>

Slain Wilde 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, 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:** ![Christian\_Neukirche1](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Christian\_Neukirche1](https://rubytalk.org/u/Christian_Neukirche1)\
**Post date:** [9 August 2006 22:28 UTC](https://rubytalk.org/t/parse-error-unexpected-expecting-kend/29775/3 "2006-08-09T22:28:42Z")

</div>

"Gerald Murray" \<gmurray@cloudnet.com\> writes:

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

> **···**
>
> > regards,  
> > Gerald
> 
> --  
> Christian Neukirchen \<chneukirchen@gmail.com\> [http://chneukirchen.org](http://chneukirchen.org)
