To get barcode-generator for rails working I needed to get ImageMagicK installed. I had some problems installing it using the instructions on the site. I was using the following posts to get ImageMagicK installed:

RMagicK from source on Snow Leopard
Installing ImageMagicK & RmagicK on Leopard
RMagick & ImageMagick from Source: Mac OSX Leopard

Problem 1: For some reason curl was not working. I could not decompress the files. When attempting to decompress, I would get a file with an extension of .cpgz. Attempting to open that file, I would get a zip file, unzipping that file I would get a .cpgz file. Still don’t know what was up with that! Vicious never ending cycle. Other people with similar issue.

Problem 2: Could not get littlecms and libwmf compiled and installed. Would fail at the make clean step.

Problem 3: ImageMagicK installation instructions using the Apple binary did not work for me.

Below you can find the steps I used to get ImageMagicK compiled and installed with updated links to the latest stable releases – as of today:

wget http://hivelocity.dl.sourceforge.net/project/freetype/freetype2/2.3.11/freetype-2.3.11.tar.gz
tar xzvf freetype-2.3.11.tar.gz
cd freetype-2.3.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
 
wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.0.tar.gz
tar xzvf libpng-1.4.0.tar.gz
cd libpng-1.4.0
./configure --prefix=/usr/local
make
sudo make install
cd ..
 
wget http://www.ijg.org/files/jpegsrc.v8.tar.gz
tar xzvf jpegsrc.v8.tar.gz
cd jpeg-8
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.6.2
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..
 
wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.2.tar.gz
tar xzvf tiff-3.9.2.tar.gz
cd tiff-3.9.2
./configure --prefix=/usr/local
make
sudo make install
cd ..
 
wget http://ghostscript.com/releases/ghostscript-8.70.tar.gz
tar xzvf ghostscript-8.70.tar.gz
cd ghostscript-8.70/
./configure  --prefix=/usr/local
make
sudo make install
cd ..
 
wget ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/ghostscript-fonts-std-8.11.tar.gz
tar xzvf ghostscript-fonts-std-8.11.tar.gz
sudo mv fonts /usr/local/share/ghostscript
 
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xzvf ImageMagick.tar.gz
cd ImageMagick-6.5.9-3/
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
cd ..

After installation, check if ImageMagicK was installed correctly. The following command should create a new file called logo.gif with the ImageMagicK logo:

/usr/local/bin/convert logo: logo.gif

For a more comprehensive test, run the following command:

make check

Results:

make check
make  check-am
make  tests/validate  wand/drawtest wand/wandtest
  CC     tests/tests_validate-validate.o
  CCLD   tests/validate
  CC     wand/drawtest.o
  CCLD   wand/drawtest
  CC     wand/wandtest.o
  CCLD   wand/wandtest
make  check-TESTS check-local
PASS: tests/validate-compare.sh
PASS: tests/validate-composite.sh
PASS: tests/validate-convert.sh
PASS: tests/validate-formats-on-disk.sh
PASS: tests/validate-formats-in-memory.sh
PASS: tests/validate-identify.sh
PASS: tests/validate-import.sh
PASS: tests/validate-montage.sh
PASS: tests/validate-stream.sh
PASS: wand/drawtest.sh
PASS: wand/wandtest.sh
===================
All 11 tests passed
===================