OSX Lion Rubygame Install
Posted in Libraries on November 28th, 2011 by Jamie – Be the first to commentI tried setting up Rubygame on Snow Leopard this time last year. I had many difficulties setting up SDL. I had some time to kill so I tried to set it up again, this time on my new MacBook Air running Lion.
This old blog post from 2005 helped me this time around: http://inquirylabs.com/blog2005/?p=21 to nail down the requirements. Instead of following the installation instructions here, I used Homebrew to set things up.
One of the key requirements is rubysdl, ruby bindings for the SDL multimedia library, and the rsdl gem. The following Gist is a rubysdl Homebrew formula that will help install the required packages: https://gist.github.com/1394440. The SGE formula is not part of the included formulas. I forked the following Gist to provide SGE: https://gist.github.com/1394414/.
# install the sge graphics lib wget https://gist.github.com/raw/1394414/4a6bfa4a8bab179ebe263b1d044a4322c7628f60/sge.rb brew install sge # install rubysdl ruby sdl bindings wget https://raw.github.com/gist/1394440/8a71160306ad277f08fbad3eaf028b2e8700f2f1/rubysdl.rb brew install rubysdl # install the required gem gem install rsdl gem install rubygame
Afterwards, most of the rubygame samples ran fine, but the ones requiring opengl had issues. I installed ruby 1.9.2 using rbenv, compiled a new dynamic library libruby.dylib, based on the 1.9.2 source. Then, I cloned this repo providing an upgraded ruby-opengl gem: https://github.com/theymaybecoders/ruby-opengl.
# clone the repo git clone https://github.com/theymaybecoders/ruby-opengl cd ruby-opengl # make sure that the libruby.1.9.1.dylib compiled from the # ruby 1.9.2 source is present in the gcc class path. For # me, it was ~/.rbenv/versions/1.9.2-p290/lib/libruby.dylib # use build option --enable-shared rake # build the gem rake gem # install the gem gem install pkg/ruby-opengl-0.60.1.gem
Afterwards, the rubygame opengl samples compiled fine.





