Rails Project Won't Compile - No Detailed Errors - Help!

When I try to run my rails project, I get a message that there is a
syntax error and the application cannot compile (see below). However,
it does not tell me which file has this error. So instead of saying
“(index.erb):56: syntax error, unexpected $end, expecting ‘)’” it
just has (erb) where it should provide a filename.

Can someone provide some pointers to help me narrow the field a bit?

ERROR MESSAGE:

Fast Debugger (ruby-debug-ide 0.4.9) listens on :xxxx
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
(erb):56
Uncaught exception: compile error
(erb):56: syntax error, unexpected $end, expecting ‘)’
; _erbout
^

On Feb 26, 12:37am, noname [email protected] wrote:

When I try to run my rails project, I get a message that there is a
syntax error and the application cannot compile (see below). However,
it does not tell me which file has this error. So instead of saying
“(index.erb):56: syntax error, unexpected $end, expecting ‘)’” it
just has (erb) where it should provide a filename.

Can someone provide some pointers to help me narrow the field a bit?

In the absence of more forthcoming error messages I’d try removing erb
files from the project until the error goes. Once you know which file
has the error you should be in a better position to work out what it
is. You might also want to git bisect to try and find the revision
that added the problem (assuming you are using git)

Fred

On 26 February 2011 00:37, noname [email protected] wrote:

When I try to run my rails project, I get a message that there is a
syntax error and the application cannot compile (see below). However,
it does not tell me which file has this error. So instead of saying
“(index.erb):56: syntax error, unexpected $end, expecting ‘)’” it
just has (erb) where it should provide a filename.

Can someone provide some pointers to help me narrow the field a bit?

Is there anything in the log file (log/development.log assuming you
are in development mode)?

Are you running the server from netbeans? If so have you tried
running from command line just in case it is a netbeans issue?

If you make a new rails app does it run?

Colin

On 26 February 2011 00:37, noname [email protected] wrote:

ERROR MESSAGE:
Uncaught exception: compile error
(erb):56: syntax error, unexpected $end, expecting ‘)’
; _erbout

Can someone provide some pointers to help me narrow the field a bit?

This is a horrid error to debug, because of the nature of it. You’ve
left off a closing bracket somewhere, so the interpreter has gotten
all the way to the last “end” and said, “hang on, I have one opening
bracket too many” and baulked.

The easiest way to debug it is to go back to the last edits you did,
and look at the code for any unexpected indentation (if your editor
supports auto-indenting, or even better, identifying unclosed
brackets, it will help).
Otherwise, you’re approach could be to remove all your files from the
app, and introduce them back one or two at a time - when it breaks,
you have narrowed-down the source of the problem… of course, this
approach has the difficulty of having to potentially make large edits
to the code to get it running with no models… :-/

Sorry I can’t be any more help.
M

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs