Gleaned these instructions from a rubyonrails-talk thread. Another thing is mysql is a bit funky, you can't use the built in control panel, but following these instructions makes it work.
Full installation instructions (full credit goes to: Michael Steinfeld for figuring this out)
- I started with a clean install of Leopard.
- Install macports for 10.4
- Install the xcode dev tools from the Leopard disk - *be sure to also install the 10.3 sdk from the xcode dev tools install*
- sudo port install freeimage
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_freeimage/work/FreeImage
and change this:
LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.3.9.sdk LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
to this
LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.3.9.sdk/usr/lib LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
sudo port install freeimage
- sudo gem install -y imagescience
- cd /Library/Ruby/Gems/1.8/gems/RubyInline-3.6.4/lib
edit inline.rb
look for the line
flags = @flags.join(' ')
and change it to
flags = @flags.join(' ') + ' -lruby'
remove ~/.ruby_inline

Nice work Alex. It appears that the changes needed for a source install are the same as those for mac ports. I've put some directions for installing from source here
Just wanted to mention that item #7 should read:
sudo gem install -y image_science
(just in case this comment gets formatted, it should be imageUNDERSCOREscience)
Also, depending on your version of GEM, and I believe the one that ships with Leopard falls into this category, the -y option is the default and deprecated. So, -y may also be left out.
Thanks for the write up! And, very nice job.
I followed the directions but was still having problems. Removing all mention of the PPC architecture from Makefile.osx solved the problem.