2009
03.05

If you (like me) use Mac OS X for your ruby development, you might need to install the RMagick gem. ImageMagick is the essential tool when it comes to automated image processing and RMagick is a nice ruby wrapper for it. The only problem is that ImageMagick has a lot of dependencies which involve numerous libraries needing to be built (or installed) alongside with it.

Of course you might use MacPorts or Fink for the installation, but if you don’t really need these massive-impressive tools, here is a simple solution to get Rmagick installed fast. Download this tar archive, unpack it with tar xvf, cd to the getRMagick folder and launch the getRMagick.sh script. Please note that you should have Developer Tools installed on your Mac (usually available on the OS X installation DVD) as well as ruby + rubygems in order for the script to compile everything for you. After a while, if everything goes well, you’ll get the Magick stuff installed. I used the script on Intel and PowerPC Macs with OS X 10.5.6.
And yeah, the script is very simple.


#!/bin/sh
tar xzvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=/usr/local
make
sudo make install
cd ..

tar jxvf libpng-1.2.22.tar.bz2
cd libpng-1.2.22
./configure --prefix=/usr/local
make
sudo make install
cd ..

tar xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.5
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..

tar xzvf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure --prefix=/usr/local
make
sudo make install
cd ..

tar xzvf libwmf-0.2.8.4.tar.gz
cd libwmf-0.2.8.4
make clean
./configure
make
sudo make install
cd ..

tar xzvf lcms-1.17.tar.gz
cd lcms-1.17
make clean
./configure
make
sudo make install
cd ..

tar zxvf ghostscript-8.62.tar.gz
cd ghostscript-8.62/
./configure  --prefix=/usr/local
make
sudo make install
cd ..

tar zxvf ghostscript-fonts-std-8.11.tar.gz
sudo mv fonts /usr/local/share/ghostscript

tar xzvf ImageMagick-6.4.1-3.tar.gz
cd ImageMagick-6.4.1
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local --disable-static --with-modules --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
cd ..

sudo gem install rmagick

3 comments so far

Add Your Comment
  1. Норм

  2. Хм..

  3. Хм