I am converting the Recycling Group Finder site from Rails 2 to Rails 3 and though it has mostly gone to plan I was temporarily held up by this error which I was getting on some pages:
The error was hard to track down as the error message wasn’t very descriptive, but in the end it turned out to be caused by a comment. I am using content_for blocks to generate sections of page content and for a long section I had added a comment to the end of the block to help be know which block was closing:
It turns out that this ‘# some_section’ comment was the problem, possibly because of the change to erubis in Rails 3. Removing the comment caused the page to start working again:
I hope this page helps short-cut the debugging for anyone else that is bitten by this issue.
A bit off-topic, but I’m curious about your use of Dropbox here — do you use it to sync your local apps between machines, or something?
That’s correct, I use DropBox to sync selected apps between my laptop and iMac. Just the ones I will be working on on my laptop, the rest stay where they are on my iMac. It’s worked flawlessly so far.
Thanks a lot for the post! This error is a tricky one, I think you just saved me a massive headache. Seems like this is quite a dangerous bug to me.
Hey, i did exatly the same comment style and got this error. You saved me out, thanks! ^_^