Mac OS X & Rails & ImageMagick without the kruft
Recently I got one of the new Intel iMacs, and I wanted to move all my Rails development over to it. Most things went very easily, however ImageMagick doesn't seem to have a binary for Intel Macs just yet. I decided to try and install it from source. It was actually very easy to do. So if you don't feel like installing Darwin Ports/Fink just to get ImageMagick read on.
If you're not comfortable dealing with the Terminal/shell access then you may want to wait for the binary release, or go the Darwin Ports/Fink route.
Ideally you should have followed the Rails installation tutorial at
Hivelogic.
Basically you need to have your path setup to look in /usr/local/bin for binaries. If you need help doing that, have a look at the aforementioned article.
Start up Terminal(usually located in the /Applications folder).
At the prompt enter:
mkdir src
cd src
Now we're ready to get and install the required software.
Note: the order here is important.PNG
This supports PNG files. If you don't need support you can safely skip it.
curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.8-config.tar.gz
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
./configure --prefix=/usr/local
make
sudo make install
Notes:
- simplesystems ftp site seems a bit moody. You can also get the library from SourceForge.
- PNG 1.2.10, the latest version seems to have build problems on Mac OS X, try getting 1.2.8 from sourceforge.
JPEG
Pretty much everyone needs this. Unfortunately it's the most troublesome to compile and
install correctly. Follow the directions carefully. Note: The single quotes in the fourth line
are backquotes, not regular quotes. (see the tilda key)
curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar zxvf 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
TIFF
Everyone needs this as well.
curl -O ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
tar zxvf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure --prefix=/usr/local
make
sudo make install
ImageMagick
The big tamale! The [VERSION] tag below denotes the version of ImageMagick you actually got. ImageMagick.tar.gz is a link to the latest version of ImageMagick, so the version will change as they do new releases.
curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar zxvf ImageMagick.tar.gz
cd ImageMagick-[VERSION]
./configure --without-perl
make
sudo make install
Updated to use the latest version via the linked file.RMagick
One more step, add the ruby bindings to ImageMagick. You may get some errors during the Rdoc
install phase, you can safely ignore them.
sudo gem install rmagick
Woot! You're done. Have a beverage, and get down to work.