boston.rb and Ruby 1.8.7 - what does "[BUG] cross-thread violation" mean?

29 views
Skip to first unread message

Ron Newman

unread,
Nov 4, 2009, 12:55:03 AM11/4/09
to boston-r...@googlegroups.com
I downloaded the bostonrb project from github and tried to build and
run it on my Mac. It appears to run OK on Leopard's native Ruby
1.8.6, but when I run script/server on Ruby 1.8.7, I get this
mysterious error:

----------
[BUG] cross-thread violation on rb_gc()
ruby 1.8.6 (2008-08-11) [universal-darwin9.0]

Abort trap
----------

"rake tests" runs to completion with no failures or errors, so it does
not provide any clue as to what is wrong. Anyone know more?


Josh Nichols

unread,
Nov 4, 2009, 1:02:23 AM11/4/09
to boston-r...@googlegroups.com
Could you include all the output from the moment you start
script/server until it gets that error? I suspect that might have some
insight into what's failing.

- Josh

Ron Newman

unread,
Nov 4, 2009, 1:11:39 AM11/4/09
to boston-r...@googlegroups.com

On Nov 4, 2009, at 1:02 AM, Josh Nichols wrote:

> Could you include all the output from the moment you start
> script/server until it gets that error?

What I posted is the entirety of the output:

Andrew Kuklewicz

unread,
Nov 4, 2009, 1:50:14 AM11/4/09
to boston-r...@googlegroups.com
Never had this error, but here are a few thoughts.
As the message indicates 1.8.6,  I  suspect that you have both 1.8.6 and 1.8.7 installed, but however you think you are running 1.8.7, you aren't.
Perhaps both are on the path, and causing some kind of conflict?
I would try moving 1.8.6 out of the way, renaming the dir and/or moving to a dir not on the path.
Maybe also look at how your script is starting, and make sure the bang statement is resolving to the ruby version you expect.

Andrew Kuklewicz

Michael Breen

unread,
Nov 4, 2009, 6:36:14 AM11/4/09
to boston-r...@googlegroups.com
How did you go about installing 1.8.6 and 1.8.7? Are you using rvm?

John Norman

unread,
Nov 4, 2009, 7:41:39 AM11/4/09
to boston-r...@googlegroups.com
If you're using the ruby_switcher.sh, it makes the assumption that gems between 1.8.6 and 1.8.7 can be shared, including native code. So you should remove your .gem/ruby/1.8 directory and its content, and decide which version you want to use.

William Morgan

unread,
Nov 4, 2009, 7:43:13 AM11/4/09
to boston-rubygroup
Reformatted excerpts from Ron Newman's message of 2009-11-03:

> [BUG] cross-thread violation on rb_gc()
> ruby 1.8.6 (2008-08-11) [universal-darwin9.0]

Your Ruby binary is loading gems with a C component which were compiled
against a different version of Ruby. Try setting your GEM_HOME and
GEM_PATH to somewhere new, and reinstalling your gems, using the new
Ruby. Use `gem env` to confirm.
--
William <wmo...@masanjin.net>

Ron Newman

unread,
Nov 4, 2009, 7:48:53 AM11/4/09
to boston-r...@googlegroups.com

On Nov 4, 2009, at 7:41 AM, John Norman wrote:

> If you're using the ruby_switcher.sh, it makes the assumption that
> gems between 1.8.6 and 1.8.7 can be shared, including native code.

Yes, I'm using ruby_switcher. Why is the above a bad assumption?
Are some gems incompatible between the two versions?


John Norman

unread,
Nov 4, 2009, 9:53:01 AM11/4/09
to boston-r...@googlegroups.com
All I can tell you is that by carefully partitioning your Ruby 1.8.6 and 1.8.7, you can get boston.rb built and running. I'm running both right now. Haven't tried under 1.9.1 :-)

I think the offending gem is json-1.1.7, but without more time . . . hard to say.

The rvm gem might do a better job with this.
Reply all
Reply to author
Forward
0 new messages