Illegal char \002? Need to restart Rails to see changes?

Hi all,

I’m developing an app on a home Windows computer and using
SVN/Capistrano to deploy to a Linux server. I’m encountering some
bizarre behavior that I think has something to do with Linux and Windows
text file types, but I’m not sure.

What’s happening is that, whenever I edit my view files and reload the
page in my local browser, I see errors saying I have Syntax errors and
illegal characters in my files. There’s never anything obvious (to me)
wrong with the file, but if I Ctrl-C out of WEBrick and restart it, the
file works fine. Until the next time I edit it.

Here’s an example, from a change to a partial template. It was working
properly, and the only change I made was to add “

Hi

” to the top.
Then I refreshed the page in the browser and got this:

SyntaxError in Houses#list

Showing app/views/houses/_house.rhtml where line #3 raised:

compile error
./script/…/config/…/app/views/houses/_house.rhtml:3: parse error,
unexpected $, expecting kEND
_erbout.concat " <h3 class=“house_title”>"
^

Extracted source (around line #3):

1:

Hi


2:

3:

<%= link_to_unless_current h(house.address),
:action => ‘show’, :id => house.id %>


4: <%= link_to_unless_current image_tag("/images/houses/small/front",
:size => ‘150x100’), :action => ‘show’, :id => house.id %>
5: <%= “
” %>
6:

    This behavior started happening when I added the “file_column” plugin to
    my app, but I’m not sure what it has to do with it.

    It’s been really frustrating getting SVN and Capistrano set up and now
    I’m finally ready to just start working on the actual behavior of my
    app, I find all these problems that are beyond the scope of my
    understanding. I’ve rebuilt my app half a dozen times today, starting
    from scratch with fresh Rails installs and incrementally copying files
    in and still I can’t squash these problems.

    Help!

    Jeff

    P.S. I kinda feel like I’ve been monopolizing this list, posting quite a
    few requests for help over the last few days. I apologize if that’s the
    case, but all the responses I’ve gotten have helped me immensely, so I
    keep coming back :slight_smile:

Jeff C.man wrote:

unexpected $, expecting kEND
:size => ‘150x100’), :action => ‘show’, :id => house.id %>
5: <%= “

” %>
6:

    Many people are reporting errors of this type on Windows. The reports
    claim that by replacing tabs with spaces in the source file that the
    problems are resolved.

    HTH

    Ray

How odd. That seemed to do it, for that file at least. What on earth
would be at the bottom of a bug like that?

Ray B. wrote:

Jeff C.man wrote:

unexpected $, expecting kEND
:size => ‘150x100’), :action => ‘show’, :id => house.id %>
5: <%= “

” %>
6:

    Many people are reporting errors of this type on Windows. The reports
    claim that by replacing tabs with spaces in the source file that the
    problems are resolved.

    HTH

    Ray

Found some bug reports indicating that RMagick changes the method
String.dump, which is also used in the ERB interpreter. I am indeed
using RMagick so I have no doubt that’s the culprit.

Thanks again, Ray.

Jeff

This issue is a Ruby 1.8.4 / Windows issue I believe.

On 3/30/06, Jeff C.man [email protected] wrote:

Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Ben R.
http://www.benr75.com

Richard L. wrote:

Ben R. wrote:

On 3/30/06, Jeff C.man [email protected] wrote:

Found some bug reports indicating that RMagick changes the method
String.dump, which is also used in the ERB interpreter. I am indeed
using RMagick so I have no doubt that’s the culprit.

Thanks again, Ray.

Jeff

This issue is a Ruby 1.8.4 / Windows issue I believe.

I have the same issue and downgraded back to 1.8.2 to get rid of it.

Bit of a pain. Where’s my Mac ;o)

Darn, but to run Rails 1.1 I’d need to stick with 1.8.4, right?

Jeff

Jeff C.man wrote:

Richard L. wrote:

I have the same issue and downgraded back to 1.8.2 to get rid of it.

Bit of a pain. Where’s my Mac ;o)

Darn, but to run Rails 1.1 I’d need to stick with 1.8.4, right?

Jeff

I’m running edge rails quite happily on 1.8.2

Ben R. wrote:

On 3/30/06, Jeff C.man [email protected] wrote:

Found some bug reports indicating that RMagick changes the method
String.dump, which is also used in the ERB interpreter. I am indeed
using RMagick so I have no doubt that’s the culprit.

Thanks again, Ray.

Jeff

This issue is a Ruby 1.8.4 / Windows issue I believe.

I have the same issue and downgraded back to 1.8.2 to get rid of it.

Bit of a pain. Where’s my Mac ;o)

Ben R. wrote:

To quote DHH:

“If you’re on Ruby 1.8.2 with Windows, though, you’ll want to upgrade
to the 1.8.4 (or the script/console will fail). And even if you’re on
another platform, it’s a good idea to upgrade to Ruby 1.8.4. We still
support 1.8.2, but might not in the next major release. So may as well
get the upgrading with over with now.”

On 3/30/06, Richard L. [email protected] wrote:


Ben R.
http://www.benr75.com

Hopefully by the time it becomes an issue with the next Rails release,
RMagick might be updated to fix the current issue.

Jeff

To quote DHH:

“If you’re on Ruby 1.8.2 with Windows, though, you’ll want to upgrade
to the 1.8.4 (or the script/console will fail). And even if you’re on
another platform, it’s a good idea to upgrade to Ruby 1.8.4. We still
support 1.8.2, but might not in the next major release. So may as well
get the upgrading with over with now.”

On 3/30/06, Richard L. [email protected] wrote:


Ben R.
http://www.benr75.com

Ben R. wrote:

To quote DHH:

“If you’re on Ruby 1.8.2 with Windows, though, you’ll want to upgrade
to the 1.8.4 (or the script/console will fail). And even if you’re on
another platform, it’s a good idea to upgrade to Ruby 1.8.4. We still
support 1.8.2, but might not in the next major release. So may as well
get the upgrading with over with now.”

I tried to upgrade. Things broke so I downgraded again.

Once RMagick etc work I’ll happily upgrade. Until that point the only
thing so far which doesn’t work is script/console and that’s easy to
patch.

I think its got nothing to do with RMagick but with copying code.
Had the same problem with code copied from mail.
Got an error but nothing showed up until I used ‘view’ ‘show invisibles’
in TextMate
Funny characters showed up that I deleted and all was well.
Now the code I copied was from someone on windows.

I am running on a mini with Rails 1.1 and file_column and rmagick and
very happy !!!

Hope this helps