Wierd problem has stopped my whole site working

This happened before whilst I was developing a site and never resolved
itself. Something happens and all my pages return errors like this:


SyntaxError in Siteview#index

Showing app/views/siteview/index.rhtml where line #8 raised:

compile error
./script/…/config/…/app/views/siteview/index.rhtml:8: syntax error
./script/…/config/…/app/views/siteview/index.rhtml:9: syntax error
./script/…/config/…/app/views/siteview/index.rhtml:10: syntax error

Extracted source (around line #8):

5: <% elsif @team == nil and @team_name == nil %>
6:

Welcome


7:

Please select the closest team to you for more information


8:

9:

Point your mouse over a team to view more information


10:

11:

If I refresh the page it will come up with a slightly different error.
Often with some:

./script/…/config/…/app/views/siteview/index.rhtml:8: Invalid char
`\266’ in expression

(the invalid char number varying each time I refresh)

I am very puzzled by it and don’t really know where to start to look.
From flicking around internet it seems its something to with how the
server is running and perhaps how the end of line markers work.

The strange thing is the suddeness of it coming on, from everything
working fine to it doing this on every page. There was no reset of the
server involved, and when I did restart the server it didn’t make any
difference.

I am using:
ruby 1.8.4
rails 1.1.6
on a windows xp system

cheers

Nick

oh and I’m using the webrick server

A bit more searching and I found

http://webonrails.wordpress.com/2006/08/10/tab-problem-in-rails-rhtml-files/

which says the problem is about having tabs in rhtml (and possibly
something to do with RMagick).

The solution is to put

template = template.gsub(/\t/," ")

in base.rb found in

{ruby base dir}\lib\ruby\gems\1.8\gems\actionpack-1.12.5\lib\action_view

(or similar)

as the first line of the compile_template function (line 499 on mine)

a restart of the server later and it is working

N

Thanks. it fixed my problem

I am not sure if it is because I have been starting to use Rmagick or
that I
have been messing with tab sizes in Eclipse or something else

a really annoying error

Peter

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