Last Updated: February 25, 2016
·
2.658K
· dsci

Install rmagick on OS X Mountain Lion

If you have to crop or manipulate images with Ruby sometimes you may consider using ImageMagick , an open source library to handle image editing.

After having a lot of trouble installing ImageMagick via homebrew on OS X Mountain Lion and several workarounds from the internet not fixing the issue, I was able to fix it with this solution:

First, download the ImageMagick installer.

After installing ImageMagick, return to your terminal and adjust your $PATH</code> to the newly installed ImageMagick bin</code> directory:

export PATH=/opt/ImageMagick/bin:$PATH  

Next step is to publicize your system with the ImageMagick source headers by extending

PKG_CONFIG_PATH 

Here we go:

export PKG_CONFIG_PATH="/opt/ImageMagick/lib/pkgconfig:$PKG_CONFIG_PATH"

Now it's time for the last step, installing the RMagick gem.

If you're Bundler based:

bundle install

If you're working with rubygems directly:

gem install rmagick 

Happy rmagicking.

4 Responses
Add your response

A quick intro won't hurt for some of us that don't know the famous "ImageMagick"

over 1 year ago ·

I updated the pro tip with a short introduction.

over 1 year ago ·

Thanks. After fighting for hours, this was the solution

over 1 year ago ·

thaaanks,. save my day :D

over 1 year ago ·