Forum: Ruby on Rails Illegal char \002? Need to restart Rails to see changes?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jeff C. (Guest)
on 2006-03-30 20:30
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 "<p>Hi</p>" 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: <p>Hi</p>
2: <div class="house">
3: 	<h3 class="house_title"><%= link_to_unless_current h(house.address),
:action => 'show', :id => house.id %></h3>
4: 	<%= link_to_unless_current image_tag("/images/houses/small/front",
:size => '150x100'), :action => 'show', :id => house.id %>
5: 	<%= "<div id='description_#{house.id}'>" %>
6: 	<ul class="address">


---

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 :)
Ray B. (Guest)
on 2006-03-30 20:55
(Received via mailing list)
Jeff C.man wrote:

>
> unexpected $, expecting kEND
> :size => '150x100'), :action => 'show', :id => house.id %>
> 5: 	<%= "<div id='description_#{house.id}'>" %>
> 6: 	<ul class="address">

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
Jeff C. (Guest)
on 2006-03-30 21:02
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: 	<%= "<div id='description_#{house.id}'>" %>
>> 6: 	<ul class="address">
>
> 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
Jeff C. (Guest)
on 2006-03-30 21:15
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
Ben R. (Guest)
on 2006-03-30 22:33
(Received via mailing list)
This issue is a Ruby 1.8.4 / Windows issue I believe.

On 3/30/06, Jeff C.man <removed_email_address@domain.invalid> wrote:
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Ben R.
http://www.benr75.com
Richard L. (Guest)
on 2006-03-30 23:16
(Received via mailing list)
Ben R. wrote:
> On 3/30/06, Jeff C.man <removed_email_address@domain.invalid> 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)
Jeff C. (Guest)
on 2006-03-30 23:29
Richard L. wrote:
> Ben R. wrote:
>> On 3/30/06, Jeff C.man <removed_email_address@domain.invalid> 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
Richard L. (Guest)
on 2006-03-30 23:34
(Received via mailing list)
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. (Guest)
on 2006-03-31 00:33
(Received via mailing list)
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. <removed_email_address@domain.invalid> wrote:
> >
>
--
Ben R.
http://www.benr75.com
Jeff C. (Guest)
on 2006-03-31 00:35
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. <removed_email_address@domain.invalid> 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
Richard L. (Guest)
on 2006-03-31 02:35
(Received via mailing list)
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.
Guest (Guest)
on 2006-03-31 04:19
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
This topic is locked and can not be replied to.