Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my Sproutcore development server drop connections with "invalid byte sequence in US-ASCII"?

Tags:

ruby

rubygems

Here's the stack: Sproutcore 1.0.1046. Ruby 1.9.1, in RVM. Thin 1.2.7. Thor 0.13.8. Rack 1.2.1. Eventmachine 0.12.10. Erubis 2.6.6.

When I start the sc-server on any application, my first request to this server produces this in the console log:

ArgumentError: invalid byte sequence in US-ASCII

...followed by this stack trace. (I've listed gems which appear in the stack trace above, but there's a complete gemset list in the same gist as the stack trace.)

Research on the error message points out that this is a common problem with Ruby 1.9, but the stack trace suggests that the problem is in one of the gems somewhere.

I have:

  • Upgraded my OS (Mac OS X 10.5 to 10.6) in order to get the latest gcc Apple provides.
  • Reinstalled RVM.
  • Reinstalled Ruby.
  • Reinstalled all the relevant gems.

And yet I still have this problem on one system, but not on another. (N.B. there are several devs working on this code, and I'm the only one seeing this problem. I'm 99% certain it's not our code.) I guess what I'm saying is that I've cleared and rebuilt a lot of gems to try to isolate or remove this glitch, and yet I still haven't gotten rid of it.

Where should I look next?

like image 354
pjmorse Avatar asked Dec 28 '22 08:12

pjmorse


2 Answers

You have some special setting in your bash environment that is setting ruby to use US-ASCII , this happened to me trying to execute sc-server from a remote terminal... I'm not really sure what it is, but it doesn't use UTF-8 and that's when it runs into trouble.

like image 134
Juan Pinzon Avatar answered Dec 30 '22 22:12

Juan Pinzon


You can probably also change Encoding.default_external

like image 40
rogerdpack Avatar answered Dec 30 '22 22:12

rogerdpack