mxcl/homebrew — Issue #10600: Can't install Ruby gem rmagick with imagemagick V6.7.5-7
Author: mathieul
Created: 2012-02-29 20:16:46+00:00
State: open

Steps to reproduce:

* start with a new homebrew cellar (without pkg-config actually)
* $ brew install imagemagick
* $ gem install rmagick

It fails and return the following error:

...
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/gcc-4.2... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
/usr/local/bin/Magick-config: line 41: pkg-config: command not found
/usr/local/bin/Magick-config: line 47: pkg-config: command not found
/usr/local/bin/Magick-config: line 50: pkg-config: command not found
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.1. Can't find MagickWand.h.
...

The problem is that the imagemagick formula doesn't depend on pkg-config. Adding the line below to the imagemagick formula fixes the problem:

depends_on 'pkg-config' => :build