Ming/Ruby on OS X

I’ve been experimenting with dynamically generating Flash SWF files this afternoon, using Ming and the Ming/Ruby library.

Since the Mac OS X installation was slightly non-trivial, I think it’s useful to note it down here.

This assumes that you are using Ruby from MacPorts (née Darwin Ports).

First, install some library dependencies:

sudo port install libpng zlib libungif

If you get an error like ‘Another version of blah is already active’, don’t worry: just remove it from the install line above and try again.

Download version 0.3.0 of the Ming library and extract it.

cd ming-0.3.0/
./configure "LDFLAGS=-L/opt/local/include -L/opt/local/lib" \
"CPPFLAGS=-I/opt/local/include -I/opt/local/lib" \
"CFLAGS=-I/opt/local/include -I/opt/local/lib"
make
sudo make install

Get Ming/Ruby 0.1.8 and extract it.

cd ming-ruby-0.1.8/
sudo ruby setup.rb

If all that worked, you can try a ‘Hello World’ example. The best source for documentation is at the delightfully-named Ming the Manual, although you’ll have to use your initiative to translate the method calls into Ruby (hint: change methodsLikeThis to methods_like_this).

Comments

Skip to the comment form

  1. Jarrad

    Wrote at 2007-12-30 22:18 UTC using Safari 523.12.2 on Mac OS X:

    these still work great! know if theres any ruby bindings for the latest ming? if you know how to do that please email me

Leave a comment

Please read the comment guidelines before posting. Comments are Gravatar-enabled. Your email address will not be published.

To prove that you’re human, type human in the Bot check field.

Trying to post some program output or a long code sample? Please use a paste service and link to it instead.