NameError - confused gems?

B

Brandon Jones

I have 2 gems installed: ruby-opengl and rubygame. Both gems contain
their own gl.rb file. When just ruby-opengl is installed, I can require
it fine:
require 'opengl'
=> true

Once I install rubygame, I get the NameError
require 'opengl'
NameError: uninitialized constant Rubygame
from
C:/ruby/lib/ruby/gems/1.9.1/gems/rubygame-2.6.2/lib/rubygame/gl.rb:35:in
`<top (required)>'
from
C:/ruby/lib/ruby/gems/1.9.1/gems/ruby-opengl-0.60.1-x86-mswin32/lib/opengl.rb:23:in
`require'
from
C:/ruby/lib/ruby/gems/1.9.1/gems/ruby-opengl-0.60.1-x86-mswin32/lib/opengl.rb:23:in
`<top (required)>'
from (irb):1:in `require'
from (irb):1
from C:/ruby/bin/irb.bat:20:in `<main>'

Apparently the ruby-opengl gem is calling require 'gl' and it's picking
up the one in rubygame. Is this fixable on my part (gem load path)? Or
will some change be required in one/both installed gems?
 
B

Brandon Jones

I did some digging and it turns out that renaming rubygame's file fixed
the problem. ruby-opengl was trying to require the gl.so file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,091
Latest member
IsaacLuna

Latest Threads

Top