Syntax error without obvious reason

I just made a bad experience with ruby I would like to share.

I wanted to upgrade my SuSE Linux 9.1 to version 10. Failed… during the upgrade process my machine ended up in a strange state. I was not able to boot neither from hard drive nor from Windows XP installation disk. I had to use my old Win 2000 installation CD to make it running.

As a consequence, I had to recreate the whole development environment. After few hours of work I started my application…
Before the installation it was running without any problem. After the environment was recreated, I was not able to render some views. It showed me strange syntax errors:

ActionView::TemplateError (compile error
./script/../config/../app/views/story/_showing_tags.rhtml:4: syntax error
_erbout.concat "	"
                	  ^) on line #4 of app/views/story/_showing_tags.rhtml:
…
…
…
_erbout.concat "                        ";  end ; _erbout.concat "\n"
_erbout.concat "
\n" _erbout end Backtrace: ./script/../config/../app/views/story/_showing_tags.rhtml:4:in `compile_template' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:307:in `compile_and_render_template' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in `render_template' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in `render_file' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:266:in `render' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:59:in `render_partial' c:/win32app/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:29:in `benchmark' c:/win32app/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' … … ...

In fact, the rails were complaining about the tabs before the embedded ruby commands

<%=

After changing the tabs to 2 spaces the application started… complaining about another characters.

I did some research and I was pointed to a ruby version. Before the reinstallation I was running 1.8.2. After the installation I took the latest one. Bad decision. It was caused by the ruby interpreter version.

So, if you face weird syntax errors with ruby 1.8.4 and you are sure about the syntax, try to change the version. I downgraded to 1.8.2 and it started to work again.