Installing ruby-opengl in Windows: ERROR: While executing ge

Hi. I have questions.

Because I need to generate complex simple 3D pictures in Windows XP, I
want
to use OpenGL, especially in Ruby. Please consider that I’m a complete
newbie in OpenGL.

Problem is… I cannot ‘gem’ ruby-opengl.

Here are two qustions.

  1. What do I need to install before installing ruby-opengl?
    What I did: (1) get opengl.dll, glu.dll, glut.dll from the internet and
    copied them to the windows sytem32 folder.
    (2) Installed ruby 1.8.6, rake, mkrf as shown in "
    http://ruby-opengl.rubyforge.org/build_install.html"

  2. But I cannot install ruby-opengl. Error messages are like this. (gem
    version is 0.9.2)
    What I did: (1) try installing ruby-opengl directly using gem
    (2) raking in ruby-opengl folder.

In (1), I get, "ERROR: Failed to build gem native extension.
In (2), I get, undefined method ‘exitstatus’ for nil:NilClass

Following is the detail of the output

Thank you.
Sung Soo

===========================================

C:\ruby\lib\ruby\gems\1.8\gems\ruby-opengl-0.33.0>gem install -y
ruby-opengl
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

rake RUBYARCHDIR=c:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/lib
RUBYLIBDIR=c:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/lib
extension
(in c:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0)
Building common rbogl object file
cd ext/common && rake
(in C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common)
cc -c -MD -Zi -O2b2xg- -G6 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -o
rbogl.o
rbogl.c
rake aborted!
undefined method `exitstatus’ for nil:NilClass
C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common/rakefile:38
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [cd ext/common && rake]
c:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/rakefile:56
(See full trace by running task with --trace)

Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ruby-
opengl-0.33.0 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0
/gem_make.out

C:\ruby\lib\ruby\gems\1.8\gems\ruby-opengl-0.33.0>

===========================================

C:\ruby\lib\ruby\gems\1.8\gems\ruby-opengl-0.33.0>rake
(in C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0)
Building common rbogl object file
cd ext/common && rake
(in C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common)
cc -c -MD -Zi -O2b2xg- -G6 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -o
rbogl.o
rbogl.c
rake aborted!
undefined method `exitstatus’ for nil:NilClass
C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common/rakefile:38
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [cd ext/common && rake]
C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/rakefile:56
(See full trace by running task with --trace)

C:\ruby\lib\ruby\gems\1.8\gems\ruby-opengl-0.33.0>rake --trace
(in C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0)
** Invoke default (first_time)
** Invoke build_rbogl (first_time)
** Execute build_rbogl
Building common rbogl object file
cd ext/common && rake
(in C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common)
cc -c -MD -Zi -O2b2xg- -G6 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -o
rbogl.o
rbogl.c
rake aborted!
undefined method exitstatus' for nil:NilClass C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/ext/common/rakefile:38 (See full trace by running task with --trace) rake aborted! Command failed with status (1): [cd ext/common && rake] c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:730:in sh’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:737:in call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:737:in sh’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:816:in sh' C:/ruby/lib/ruby/gems/1.8/gems/ruby-opengl-0.33.0/rakefile:56 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in call’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in each’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in invoke’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
synchronize' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in invoke’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in
invoke_prerequisites' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in each’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in send' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in each’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:in
invoke_prerequisites' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in invoke’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
synchronize' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in invoke’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in each’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7 c:/ruby/bin/rake.bat:20:in load’
c:/ruby/bin/rake.bat:20

C:\ruby\lib\ruby\gems\1.8\gems\ruby-opengl-0.33.0>

You have to setup a C development tool on Window, in order to build
native extension for Ruby.

You can either use GNU C or Visual C++.

I have the same error on my Window machine. I install Visual C++, and
afterward the error is solved.

Several users on Linux, Unix or Mac OS have the same problems, because
they don’t install C compiler tools yet. Just use the package management
to install appropriate C compiler for each environment, it will be Ok.

I am sorry. The paragraph about C compiler above is meant for people who
can not build the native extension, due to nmake error.

If you have the error “undefined method `exitstatus’ for nil:NilClass”,
it is because when you run
gem install ruby-opengl

gem looks for the newest version of opengl gem, which is very likely a
Unix version of gem. You need to look for the specific gem for win32.

I have the same problem “undefined method `exitstatus’ for nil:NilClass”
when I install rmagick (for ImageMagick) on Window XP.

So I have to download the gem rmagick-win32 to my local machine, and run
gem from local. Everything is Ok.