ruby-opengl on Ruby 1.9
So a couple days ago I was trying to install the ruby-opengl gem on
ruby 1.9, and I kept getting this error:
/usr/bin/ld: cannot find -lruby
I use rvm (Ruby Version Manager), so all my rubies are compiled from source. It turns out that you need to compile ruby 1.9 with the
--enable-shared configure option to get the linker libraries needed to compile ruby-opengl.
To do this with rvm:
rvm remove 1.9.1 # First remove ruby so we can recompile it rvm install 1.9.1 -C --enable-shared # Install and compile with the correct option rvm use 1.9.1 gem install ruby-opengl
And you’re all set with the ruby-opengl gem!