views:

395

answers:

2

When starting the server, I get this strange error after updating to Ruby 1.9:

" [BUG] cross-thread violation on rb_gc() ruby 1.8.6 (2008-08-11) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. "

My mongrel version is 1.1.6, which should be compatible with Ruby 1.9. I also still have the Ruby 1.8.6 installation, so i assume that for some reason mongrel tries to access that and kills ruby? My rails version is 2.3.4, in case it matters.

+1  A: 

which should be compatible with Ruby 1.9

Is there something specific that makes you think that? As of a couple of weeks ago, I had established that Mongrel does not work with Ruby 1.9 on Windows. I don't believe that Mongrel has been compiled successully with gcc/mingw32, which Ruby 1.9 requires.

The simplest option is to switch back to WEBRick.

It's also fairly straightforward to use Thin, which is comparable to - and possibly faster than - Mongrel. I found I needed to build it though, which will involve installing mingw. See this SO answer - get ready to build before gem install thin and it should all happen OK. Then just use thin start instead of ruby script/server.

Mike Woodhouse
According to this site (http://isitruby19.com/mongrel) some people have got it working with 1.1.6...With Webrick i get the following message:[2010-05-04 16:40:41] INFO WEBrick 1.3.1[2010-05-04 16:40:41] INFO ruby 1.9.1 (2010-01-10) [i386-mingw32][2010-05-04 16:40:41] INFO WEBrick::HTTPServer#start: pid=2696 port=3000In radrails it's shown in red, so not sure if it's normal info or error message. Anyway after that the server is running, but when i try to load the page on browser in stops.
JussiR
Ouch, too bad this don't do the line breaks correctly. Hmm, i guess i should try Thin.
JussiR
+1  A: 

I would be suspicious of the comments at your primary source -- most of the recent ones are spam comments pointing to links selling shoes or handbags.

Of those who did get it working and weren't spammers, note that they advise changing your gem source to http://gems.rubyinstaller.org or else using the 1.2.0 prerelease.

Personally, I can't think of any compelling reason to use Mongrel post-2008. There are so many better options. Thin, Unicorn, and Passenger are all actively maintained, have been 1.9-compliant for a long time, are faster in the typical benchmarks, and have different strengths in their features and ease of deployment. Mongrel was a huge step forward when it happened, but now it's a bit of an antique with no distinct advantages.

Just...anything but Webrick. Really.

SFEley