Forum: Ruby How To Rectify This Error?

Posted by Kaushik Sharma L. (kaushiksharma_l)
on 2012-09-26 08:42
Attachment: event_manager.rb (1,53 KB)
I am attaching my '.rb' file. Please check it. I am getting an error-

"C:/Ruby193/bin/rubysrc/Event_Manager/event_manager.rb:78: syntax error,
unexpected $end, expecting keyword_end"

How to rectify it?
Posted by Joel Pearson (virtuoso)
on 2012-09-26 09:54
Line 22:
@file.each do |line|

is missing "end"
Posted by Jan E. (jacques1)
on 2012-09-26 12:00
Hi,

The error message is actually telling you what's wrong: The parser ran 
into the end of the file while we was still expecing an "end".
Posted by Kaushik Sharma L. (kaushiksharma_l)
on 2012-09-26 20:55
Hey Thanks for replying. I am unable to rectify it. Where should I place 
the 'end' exactly????






Jan E. wrote in post #1077606:
> Hi,
>
> The error message is actually telling you what's wrong: The parser ran
> into the end of the file while we was still expecing an "end".
Posted by Eric Christopherson (echristopherson)
on 2012-09-26 22:19
(Received via mailing list)
On Wed, Sep 26, 2012 at 5:00 AM, Jan E. <lists@ruby-forum.com> wrote:
> Hi,
>
> The error message is actually telling you what's wrong: The parser ran
> into the end of the file while we was still expecing an "end".

True, but the error message is hard to decipher. When it says "$end",
it means the end of the file; when it says "keyword_end", it means the
actual word "end".
Posted by Henry Maddocks (Guest)
on 2012-09-26 22:34
(Received via mailing list)
On 27/09/2012, at 8:18 AM, Eric Christopherson wrote:

> On Wed, Sep 26, 2012 at 5:00 AM, Jan E. <lists@ruby-forum.com> wrote:
>> Hi,
>>
>> The error message is actually telling you what's wrong: The parser ran
>> into the end of the file while we was still expecing an "end".
>
> True, but the error message is hard to decipher. When it says "$end",
> it means the end of the file; when it says "keyword_end", it means the
> actual word "end".

WAT! "keyword_end" is hard to understand? This is the ruby equivalent of 
missing a closing brace or a semi colon. A Ruby coder is going to see 
this error message all the time.

The fact that the OP thought it was easier to post a message here rather 
than working it out himself boggles the mind.

 Henry
Posted by Eric Christopherson (echristopherson)
on 2012-09-27 21:26
(Received via mailing list)
On Wed, Sep 26, 2012 at 3:33 PM, Henry Maddocks <hmaddocks@me.com> 
wrote:
>> it means the end of the file; when it says "keyword_end", it means the
>> actual word "end".
>
> WAT! "keyword_end" is hard to understand? This is the ruby equivalent of missing 
a closing brace or a semi colon. A Ruby coder is going to see this error message 
all the time.
>
> The fact that the OP thought it was easier to post a message here rather than 
working it out himself boggles the mind.

Actually, I'd say it's the "$end" part that's hard to understand; what
the heck's that dollar sign for? But the whole thing can and should be
made more user-friendly and less dependent on the terminology used in
the implementation.

(And if these parser/lexer/whatever symbols are documented somewhere
other than the source itself, please point it out to me.)
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.