# Ruby-opengl gem not working on 1.9?

**URL:** <https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883>\
**Category:** Ruby\
**Created:** [March 3, 2009, 12:17pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883 "2009-03-03T12:17:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbaustert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Post date:** [March 3, 2009, 12:17pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883/1 "2009-03-03T12:17:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tbaustert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Post date:** [March 3, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883/2 "2009-03-03T21:01:31Z")

</div>

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-opengl-0.60.1-x86-mswin32-ruby19.gem](http://rubyforge.org/frs/download.php/52648/ruby-opengl-0.60.1-x86-mswin32-ruby19.gem)),  
so try that out. It should work with ruby 1.9.1 from [ruby-lang.org](http://ruby-lang.org) (or  
any other 1.9 version compiled with MSVC6).

Jan

---

<div class="post-metadata">

**Author:** ![tbaustert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Post date:** [March 3, 2009, 9:21pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883/3 "2009-03-03T21:21:37Z")

</div>

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-opengl-0.60.1-x86-mswin32-ruby19.gem](http://rubyforge.org/frs/download.php/52648/ruby-opengl-0.60.1-x86-mswin32-ruby19.gem)),  
> so try that out. It should work with ruby 1.9.1 from [ruby-lang.org](http://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.

---

<div class="post-metadata">

**Author:** ![tbaustert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Post date:** [March 3, 2009, 11:25pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883/4 "2009-03-03T23:25:32Z")

</div>

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-opengl-0.60.1-x86-mswin32-ruby19.gem](http://rubyforge.org/frs/download.php/52648/ruby-opengl-0.60.1-x86-mswin32-ruby19.gem)
> 
> > ),  
> > so try that out. It should work with ruby 1.9.1 from [ruby-lang.org](http://ruby-lang.org) (or  
> > any other 1.9 version compiled with MSVC6).

You should set required\_ruby\_version in for your gem as well.

---

<div class="post-metadata">

**Author:** ![tbaustert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@tbaustert](https://www.ruby-forum.com/u/tbaustert)\
**Post date:** [March 4, 2009, 3:30am UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-not-working-on-1-9/161883/5 "2009-03-04T03:30:40Z")

</div>

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
