ImageMagick and rmagic install HELL

I’m mainly writing this post for myself because like so many before me that are running OS X / Rails environment …… Installing imagemagick and rmagic gem is pure HELL. Here are the steps that fixed it for me.

1. Install imagemagick via homebrew 

brew install imagemagick -f

 

2. Follow steps for creating symlinks like so. be sure to pay attention to the version number in the cd line of code and change it to whatever version you are currently running. 

cd /usr/local/Cellar/imagemagick/6.8.0-10/lib
ln -s libMagick++-Q16.7.dylib   libMagick++.dylib
ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib

3. Install the gem via the command line with the following code. I made sure I was in the directory of my rails app but I’m not sure if that matters. In my case the rails app needed rmagick version 2.12.2 so I made sure to specify the version number below. 

PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick gem install rmagick -v '2.12.2'