[ruby-opengl-devel] Recent issues compiling / running ruby-opengl

Daniel Aquino mr.danielaquino at gmail.com
Tue Jan 3 23:36:56 EST 2012

I had to change STR2CSTR in ext/glut/glut.c to StringValuePtr since
STR2CSTR is deprecated after ruby 1.8.

Also there appears to be some type of problem with freeglut lately
complaining about undefined reference to glutBitmap8By13.

Since I don't even use glut in my program I simply commented out
everything to do with glut in lib/opengl.rb

Basically did the following will get you working again:

gem fetch ruby-opengl
mkdir ruby-opengl
cd ruby-opengl
tar -xvf ../ruby-opengl-0.60.1.gem
gunzip metadata.gz
tar -xvzf data.tar.gz
rm data.tar.gz
sed -i 's/STR2CSTR/StringValuePtr/g' ext/glut/glut.c
sed -i 's/0\.60\.1/&.2/g' Rakefile
# apply the changes below to lib/opengl.rb
rake clean
rake gem
gem install pkg/ruby-opengl-

--- lib/opengl.rb.orig	2012-01-03 23:29:16.069335252 -0500
+++ lib/opengl.rb	2012-01-03 23:12:34.636455503 -0500
@@ -22,9 +22,9 @@

 require 'gl'
 require 'glu'
-require 'glut'
+#require 'glut'

-include Gl,Glu,Glut
+include Gl,Glu#,Glut

 # (Gl.)glVertex -> GL.Vertex
 # (Gl::)GL_TRUE -> GL::TRUE
@@ -65,6 +65,7 @@

 # (Glut.)glutInit -> GLUT.Init
 # (Glut::)GLUT_RGBA -> GLUT::RGBA
 module GLUT
@@ -82,3 +83,4 @@
 		public( n )

More information about the ruby-opengl-devel mailing list