Forum: Ruby ruby-opengl gem not working on 1.9?

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.
Thomas B. (Guest)
on 2009-03-03 13:17
Hello. I have a problem with making ruby-opengl work on Ruby 1.9.1,
Windows.

I download the gem named ruby-opengl-0.60.1-x86-mswin32.gem and install
it - the installation is successful. But then when I try to require
'opengl', I get a Windows error that the file msvcrt-ruby18.dll cannot
be loaded.

If I take the file msvcrt-ruby18.dll from Ruby 1.8.6 and put it in 1.9's
bin dir, then I get:
 [BUG] cross-thread violation on rb_gc()
 ruby 1.8.6 (2008-08-11) [i386-mswin32]
So the error says that I'm using Ruby 1.8, but at the time of this test
Ruby 1.8 wasn't even on my PATH (I renamed its directory to avoid
collisions).

But if I take the file msvcrt-ruby191.dll that comes with Ruby 1.9 and
rename it to msvcrt-ruby18.dll then I get an elaborate segmentation
fault from gl.so (but at least now the Ruby version reported is ruby
1.9.1p0).

I see that the name msvcrt-ruby18.dll is referenced from inside gl.so,
glu.so and glut.so, so it looks to me like there's no way to use it
under Ruby 1.9 without recompiling or something. But is there any
simpler solution? I'd rather not compile opengl myself.

I can't find any information about the problems I encounter on the
ruby-opengl's website nor anywhere. All I see is they suggest that it
should work with Ruby 1.9 too. Anyone else has had this kind of
problems?

Thanks in advance.
Jan D. (Guest)
on 2009-03-03 22:01
(Received via mailing list)
Thomas B. wrote:
> Hello. I have a problem with making ruby-opengl work on Ruby 1.9.1,
> Windows.
>
> I download the gem named ruby-opengl-0.60.1-x86-mswin32.gem and install
> it - the installation is successful. But then when I try to require
> 'opengl', I get a Windows error that the file msvcrt-ruby18.dll cannot
> be loaded.
>
>
Yes, ruby 1.8 and 1.9 are not binary compatible in general, the binary
gem on rubyforge is intended for use with ruby 1.8. I just uploaded on
rubyforge gem  compiled against 1.9.1
(ruby-opengl-0.60.1-x86-mswin32-ruby19.gem
<http://rubyforge.org/frs/download.php/52648/ruby-o...),
so try that out. It should work with ruby 1.9.1 from ruby-lang.org (or
any other 1.9 version compiled with MSVC6).

Jan
Thomas B. (Guest)
on 2009-03-03 22:21
Jan D. wrote:
> Yes, ruby 1.8 and 1.9 are not binary compatible in general, the binary
> gem on rubyforge is intended for use with ruby 1.8. I just uploaded on
> rubyforge gem  compiled against 1.9.1
> (ruby-opengl-0.60.1-x86-mswin32-ruby19.gem
> 
<http://rubyforge.org/frs/download.php/52648/ruby-o...),
> so try that out. It should work with ruby 1.9.1 from ruby-lang.org (or
> any other 1.9 version compiled with MSVC6).
>
> Jan

Seems to work with no problems. Thank you very much! I'm going to use
Ruby with OpenGL in my MSc project so it's really great that I can use
Ruby 1.9 now.

Tom.
Eric H. (Guest)
on 2009-03-04 00:25
(Received via mailing list)
On Mar 3, 2009, at 11:58, Jan D. wrote:
>>
>>
> Yes, ruby 1.8 and 1.9 are not binary compatible in general, the binary
> gem on rubyforge is intended for use with ruby 1.8. I just uploaded on
> rubyforge gem  compiled against 1.9.1
> (ruby-opengl-0.60.1-x86-mswin32-ruby19.gem
> <http://rubyforge.org/frs/download.php/52648/ruby-o...
> >),
> so try that out. It should work with ruby 1.9.1 from ruby-lang.org (or
> any other 1.9 version compiled with MSVC6).

You should set required_ruby_version in for your gem as well.
Jan D. (Guest)
on 2009-03-04 04:30
(Received via mailing list)
Eric H. wrote:
> You should set required_ruby_version in for your gem as well.
Thanks, it should be set now for both binary gems.

Jan
This topic is locked and can not be replied to.