If you’re bored at your next family party or are looking to light up a late night party with friends you should try installing RMagick on your Mac. It’s so rewarding when you finally go trough it 6 hours later, exhausted, hungry and with a sense of relief that make you feel like you could fly even after eating at Schwartz.
So here’s a little help to get the party started with installing RMagick on Mac OS X from source.
To setup this stuff at StandoutJobs, my starting point was the Hivelogic tutorial. Everyone seem to have the same error: Bus error. After a couple hours banging my head against our StandoutWalls™ I ended up bleeding from the ears and with this reviewed script:
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 ..
Now this part was missing from the original tutorial, ghostscript fonts are needed, get the package from http://sourceforge.net/projects/gs-fonts/ and
tar vzxf ghostscript-fonts-std-8.11.tar.gz
sudo mv fonts/ /usr/local/share/ghostscript/fonts/
Another missing was the oh-so-obvious (!) exporting of the variables: CPPFLAGS and LDFLAGS, summed up here for your own pleasure:
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
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 ..
Now cross your fingers, get your rabit paw, make a little prayer and
sudo gem install RMagick
You’re done (or back to first step)!









39 Comments
June 19, 2007 at 4:19 pm
i don’t see the point. can’t you use locomotive for development on you mac?
June 19, 2007 at 4:25 pm
I prefer to keep everything under control and install everything from source under /usr/local.
See http://hivelogic.com/narrative/articles/using_usr_local
June 19, 2007 at 9:55 pm
ok. i read the article. mmm i will still continue with locomotive.
– although one good thing about what you did is that it trains you when you’ll setup a linux server (for production). installing rmagick is nothing compared to that
June 20, 2007 at 2:33 pm
[...] easier than this [...]
June 20, 2007 at 3:06 pm
You might also find it helpful to install many of your libraries using Fink. I did this for ghostscript, freetype, and a number other libraries, which cut down on the total install time significantly.
June 20, 2007 at 3:07 pm
[...] Get the whole story… [...]
June 20, 2007 at 3:10 pm
–with-quantum-depth=8
That’s quite the LDFLAG.
June 20, 2007 at 3:51 pm
[...] Ruby Guru, Marc-André Cournoyer, has written a Guide to Installing RMagick on Mac OS X. The existing guides and tutorials seem to miss a few critical steps, and his guide will be sure to [...]
June 20, 2007 at 6:07 pm
Or you could just download and run the rmagick-osx-installer script from http://rubyforge.org/projects/rmagick/
June 20, 2007 at 6:51 pm
Even tought it’s quicker to install a prebuilt package you might get troubles later on and won’t know where your stuff is and how to fix em.
Thank you all for the comments and link love!
June 20, 2007 at 6:58 pm
[...] Don’t you wanna feel the RMagick pain ? (or Guide to installing RMagick on Mac OS X) If you’re bored at your next family party or are looking to light up a late night party with friends you should […] [...]
June 21, 2007 at 8:27 am
I did the same thing a couple of years ago and wrote some similar instructions up, but then I eventually found it’s a lot easier to port install imagemagick and then install the rmagick gem. That said, I’ve just noticed there’s a port called “rb-rmagick”.. wonder if that could turn it into a one liner
I’m surprised at all the bits and pieces surrounding the libjpeg install.. back when I did it last it was a bit easier, although it’s been a few months since I last did it that way.
June 21, 2007 at 9:18 am
I’ll try this next time Peter, thanks for the pointer!
June 21, 2007 at 4:44 pm
This is an amazing guide!
June 22, 2007 at 8:23 am
glad it was helful to you Motorcycle Guy!
June 23, 2007 at 12:46 pm
[...] Ruby and Image Magick Filed under: OSX — 0ddn1x @ 2007-06-23 17:45:24 +0000 http://macournoyer.wordpress.com/2007/06/19/dont-you-wanna-feel-the-rmagick-pain/ [...]
June 24, 2007 at 8:59 pm
I tried it multiple times, from various angles and it always crapped the hell out on me .. I spent a good day and a half going through this and in the end just put RMagick in my FUKKET file.
I will not use RMagick. That is it! I don’t care if I can’t do the cool stuff.. the thing was just too hairy to install on osx. It might be a bit easier with the dmg installer and whatnot, but I tried the longer way (port++) and just didn’t have any luck whatsoever…
It was one of the most frustrating install experiences of my mac existenz! I hope it is better now. I will NEVER use ImageMagick EVER again.
July 9, 2007 at 9:13 am
Peter was right. “sudo port install rb-magick” worked with no pain at all.
Thanks!
July 9, 2007 at 9:14 am
“sudo port install rb-rmagick” that is
July 24, 2007 at 10:32 am
[...] looks easy enough but I wanted more control over the installation so I ended up following Marc-André Cournoyer who wrote a very handy tutorial on installing everything by hand which I followed to the letter and [...]
July 25, 2007 at 2:42 pm
mike – I definitely know the feeling.
I personally don’t get the obsession with RMagick.
You can install ImageMagick (a lot easier) and simply write a few wrappers for the necessary command-line functions you need to call from it.
Marc – thanks for the writeup!
ps. I’m surprised ’sudo port installl rb-rmagick’ works so easily. think I’ll give that a try first!
July 28, 2007 at 9:20 pm
@mike
Please don’t blame ImageMagick, it’s a very nice package that causes no trouble to billions (according to my latest statistics) of happy Linux and BSD users
August 6, 2007 at 4:15 pm
Update:
sudo port installl rb-rmagick
Did not work for me. Had to compile everything by hand. Thanks again for the great writeup!
August 16, 2007 at 2:35 pm
ok THANKS – i used this guide because I upgraded to ruby 1.8.6
and I discovered with horror that when you upgrade ruby, you have to reinstall everything else (rubygem, rails, ImageMagick and all other gems you are using).
August 16, 2007 at 4:02 pm
wooha! glad you found the joy of installing from source Heri
August 25, 2007 at 5:23 am
Great article, especiall as Hivelogic’s Rmagick tutorial is down. I feel I’m so close to the holy grail but after running make on the image magick install, I get:
magick/type.c: In function ‘LoadFontConfigFonts’:
magick/type.c:643: error: ‘FC_WIDTH’ undeclared (first use in this function)
magick/type.c:643: error: (Each undeclared identifier is reported only once
magick/type.c:643: error: for each function it appears in.)
magick/type.c:651: warning: implicit declaration of function ‘FcFini’
magick/type.c:689: error: ‘FC_WIDTH_ULTRACONDENSED’ undeclared (first use in this function)
magick/type.c:691: error: ‘FC_WIDTH_EXTRACONDENSED’ undeclared (first use in this function)
magick/type.c:693: error: ‘FC_WIDTH_CONDENSED’ undeclared (first use in this function)
magick/type.c:695: error: ‘FC_WIDTH_SEMICONDENSED’ undeclared (first use in this function)
magick/type.c:697: error: ‘FC_WIDTH_NORMAL’ undeclared (first use in this function)
magick/type.c:699: error: ‘FC_WIDTH_SEMIEXPANDED’ undeclared (first use in this function)
magick/type.c:701: error: ‘FC_WIDTH_EXPANDED’ undeclared (first use in this function)
magick/type.c:703: error: ‘FC_WIDTH_EXTRAEXPANDED’ undeclared (first use in this function)
magick/type.c:705: error: ‘FC_WIDTH_ULTRAEXPANDED’ undeclared (first use in this function)
magick/type.c:708: error: ‘FC_WEIGHT_THIN’ undeclared (first use in this function)
magick/type.c:710: error: ‘FC_WEIGHT_EXTRALIGHT’ undeclared (first use in this function)
magick/type.c:714: error: ‘FC_WEIGHT_NORMAL’ undeclared (first use in this function)
magick/type.c:722: error: ‘FC_WEIGHT_EXTRABOLD’ undeclared (first use in this function)
magick/type.c:605: warning: unused parameter ‘exception’
make: *** [magick/magick_libMagick_la-type.lo] Error 1
Any ideas? Everything else installed faultlessly and I’ve got ghostscript and ghostscript fonts.
Cheers
Adam
August 30, 2007 at 7:50 am
Great, now all works fine, imagemagick OK, RMagick OK.
Thank you.
Luca.
October 3, 2007 at 1:34 pm
Thanks for the nice instructions.
I could not get libjpeg to configure on my intel 10.4 OS with your steps, but these worked:
http://snippets.dzone.com/posts/show/38
Maybe they’ll help someone.
October 9, 2007 at 9:26 am
[...] read more | digg story [...]
October 15, 2007 at 8:11 am
[...] of the more painful things you can do on a Mac is install ImageMagick and RMagick. Until I found these instructions. Detailed, and they [...]
October 22, 2007 at 12:08 am
I can’t get past this step?
harrel-blatts-computer:~/desktop harrelblatt$ sudo mv fonts/ /usr/local/share/ghostscript/fonts/
mv: rename fonts/ to /usr/local/share/ghostscript/fonts/: No such file or directory
November 3, 2007 at 8:11 am
[...] read more | digg story [...]
December 11, 2007 at 2:18 pm
[...] My colleague has another installation instructions on OS X 10.4 (Tiger). [...]
June 25, 2008 at 10:57 am
Anybody else getting:
mv: rename fonts/ to /usr/local/share/ghostscript/fonts/: No such file or directory
You simple need to create the ghostscript directory first:
sudo mkdir /usr/local/share/ghostscript
I’ve posted an article on the changes I had to make to get this installed:
http://utopia365.blogspot.com/2008/06/installing-rmagick-on-os-x.html
August 4, 2008 at 2:17 am
Hey man !
U did greatest tutorial for rmagick here !!
Works for me well !!
Thanks you alot !!!
December 8, 2008 at 2:00 pm
If you are ever in Austin, I owe you a beer or frosty beverage of your choice.
February 3, 2009 at 5:29 am
Try Linux From Scratch, linuxfromscratch.org
April 22, 2009 at 9:17 am
I found the first line:
http://www.very-clever.com/download/nongnu/freetype/freetype-2.1.10.tar.gz
worked instead
November 11, 2009 at 5:45 pm
Hi! tOnIAW