Subscribe to RSS

Installing RMagick Ruby Gem on Mac OS X 10.4.9

When you want to manipulate images with Ruby (or your Rails application) you’ll probably want RMagick installed. This is no easy feat on Mac OS X.

The official guide suggests installing X11 and using darwinports to install everything. This guide shows you how to easily install RMagick on you Mac OS X system. In this case I use Mac OS X 10.4.9.

Before you jump in, make sure you have Xcode installed. You can get it for free from Apple.

I’ll also assume you have Ruby and rubygems installed and working already.

You will need to download, compile and install several graphics libraries that RMagick needs. Let’s do this now.

curl -O http://download.savannah.gnu.org/releases/freetype/freetype-2.1.10.tar.gz
tar xzvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure --prefix=/usr/local
make
sudo make install
cd ..
 
curl -O http://superb-west.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.10.tar.bz2
bzip2 -dc libpng-1.2.10.tar.bz2 | tar xv
cd libpng-1.2.10
./configure --prefix=/usr/local
make
sudo make install
cd ..
 
curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
tar xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..
 
curl -O ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz
tar xzvf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure --prefix=/usr/local
make
sudo make install
cd ..

Next we install ImageMagick:

curl -O http://easynews.dl.sourceforge.net/sourceforge/imagemagick/ImageMagick-6.3.0-0.tar.gz
tar xzvf ImageMagick-6.3.0-0.tar.gz
cd ImageMagick-6.3.0
./configure --prefix=/usr/local
make
sudo make install
cd ..

And now, ladies and gentlemen, what you’ve all been waiting for: RMagick:

sudo gem install --no-rdoc --no-ri RMagick

In my case the generation of the documentation fails, so I tell rubygems not to compile the docs.

You now have RMagick installed on you Mac OS X 10.4.9 machine! Congratulations!

Please share the love of this post by bookmarking it, and sharing it with others. Thanks!

  • Digg
  • del.icio.us
  • description
  • Reddit
  • Technorati
  • BlinkList
  • E-mail this story to a friend!
  • Facebook
  • Live
  • MisterWong
  • Netvouz
  • NewsVine
  • Slashdot
  • SphereIt

5 Comments

  1. Posted 17 June, 2007 at 18:30 | Permalink

    thank you! :) I was having trouble with ri and rdoc generation, but –no-ri and –no-rdoc worked fine.

  2. Posted 19 July, 2007 at 21:02 | Permalink

    Worked great — thanks!

  3. Posted 28 July, 2007 at 23:44 | Permalink

    Excellent instructions, worked perfectly. Thank you!
    Used GraphicsMagick (minus PERLMagick) instead of ImageMagick.

    curl -O ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-1.1.8.tar.bz2
    bzip2 -dc GraphicsMagick-1.1.8.tar.bz2 | tar xv
    cd GraphicsMagick-1.1.8
    ./configure –prefix=/usr/local –without-perl
    make
    sudo make install
    cd ..

    Installation of the RMagick gem was flawless.

  4. Posted 26 October, 2007 at 18:11 | Permalink

    Just worked fine for Leopard, with changes to latest download locations and “export MACOSX_DEPLOYMENT_TARGET=10.5″ of course.

  5. Posted 27 January, 2008 at 01:59 | Permalink

    For the love of god thank you! This has been a major headache for me and you’ve solved it in a few easy steps! thank you thank you thank you!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*