1. Skip to navigation
  2. Skip to content

The ELC Community Blog

A knowledge exchange on Ruby on Rails and Agile Development


Installing Freeimage + image_science on Leopard

by Jeff Emminger on November 07, 2007

So I upgraded to Leopard the other day (actually I did a clean install), and all is well until I attempted to start a rails project that uses image_science. image_science depends on Freeimage as I'm sure you're aware, and the Freeimage install was failing spectacularly. Google to the rescue! Here's how I got it to install:

From http://www.ruby-forum.com/topic/129554#578387

1. I started with a clean install of Leopard.
2. Install macports for 10.4
3. Install the xcode dev tools from the Leopard disk - *be sure to also install the 10.3 sdk from the xcode dev tools install*
4. sudo port install freeimage
5. 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

6. sudo port install freeimage
7. sudo gem install -y imagescience
8. cd /Library/Ruby/Gems/1.8/gems/RubyInline-3.6.4/lib
9. edit inline.rb
look for the line
flags = @flags.join(' ')
and change it to
flags = @flags.join(' ') + ' -lruby'
10. remove ~/.ruby_inline

Some notes:

Step #5 pertains to the file Makefile.osx

Before attempting to install freeimage again in step #6, be sure to cd out of /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_freeimage/work/FreeImage I just did a "cd ~" before "sudo port install freeimage"

Big thanks and all credit to original posters Thomas Mango and Michael Steinfeld for this information.

Comments

Johan Laidlaw at 1:50 PM on November 9 2007

Thanks for the help. I also had to change MacOSX10.3.9 to MacOSX10.5 everywhere in the Makefile.osx to make it work.

Dave South at 8:52 PM on December 5 2007

The Image Science gem has an underscore in it.

sudo gem install -y image_science

Add a comment


home | services | Ruby on Rails Development | code | blog | company