Skip to content

Instantly share code, notes, and snippets.

@gkaemmer
Last active December 8, 2015 21:17
Show Gist options
  • Save gkaemmer/25616cacd69a70f90e84 to your computer and use it in GitHub Desktop.
Save gkaemmer/25616cacd69a70f90e84 to your computer and use it in GitHub Desktop.
Installing RMagick/ImageMagick Sucks A Lot

The Problem

Just running brew install imagemagick literally never works.

The motivation here is the abundance of problems like this one, this one, this one, and every other search result for imagemagick os x error.

It's ridiculous. All we're really trying to do is resize a picture of our user's dog.

The Plan

The plan here is to make a definitive guide to successfully installing ImageMagick and RMagick on the newest version of OS X, such that no hiccups are even possible. We (the pissed off development community) will aim to install every possible feature of ImageMagick, so that we don't have to deal with errors regarding missing modules, etc.

Below, an epic bash script will grow. This bash script will, with collaboration, perform a successful and hassle-free installation of ImageMagick and (optionally) RMagick.

The Brew

ImageMagick:

brew update
brew uninstall libjpeg pkg-config ghostscript imagemagick --force
brew install libjpeg pkg-config ghostscript
brew install imagemagick --force --disable-openmp --with-ghostscript

RMagick:

export IMAGEMAGICK_DIRECTORY=`echo /usr/local/Cellar/imagemagick/6.*.*-*` && \
  C_INCLUDE_PATH=$IMAGEMAGICK_DIRECTORY/include/ImageMagick-6 \
  PKG_CONFIG_PATH=$IMAGEMAGICK_DIRECTORY/lib/pkgconfig/ \
  gem install rmagick

As of July 22, 2015, these commands work for me. I explicitly needed PDF capability, hence the ghostscript stuff. If this script is missing things, make a comment and I'll add them.

We can solve this together. Happy resizing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment