title: RMagick installation: Can't find MagickWand.h
body: <p>Updating <a href="https://github.com/rmagick/rmagick" rel="noreferrer">RMagick</a> and <a href="http://www.imagemagick.org" rel="noreferrer">Imagemagick</a> is a painful expierence. I have updated the Imagemagick version on my mac (MacOS El Capitan Version 10.11.5) with homebrew for one project in Ruby 2.3 to <code>6.9.5-9</code> </p>
  
  <pre><code>$ convert --version
  Version: ImageMagick 6.9.5-9 Q16 x86_64 2016-09-09
  </code></pre>
  
  <p>Now an older project in Ruby 1.8.7 refuses to work with the error message "this installation of RMagick was configured with ImageMagick 6.8.9 but ImageMagick 6.9.5-9 is in use". Thus I uninstalled "rmagick", but it can not be installed again</p>
  
  <pre><code>$ gem install rmagick -v 2.16.0
  Building native extensions.  This could take a while...
  ERROR:  Error installing rmagick:
  ERROR: Failed to build gem native extension.
  
  checking for /usr/local/opt/gcc46/bin/gcc-4.6... yes
  checking for Magick-config... yes
  checking for outdated ImageMagick version (&lt;= 6.4.9)... no
  checking for presence of MagickWand API (ImageMagick version &gt;= 6.9.0)... no
  checking for Ruby version &gt;= 1.8.5... yes
  checking for stdint.h... no
  checking for sys/types.h... no
  checking for wand/MagickWand.h... no
  
  Can't install RMagick 2.16.0. Can't find MagickWand.h. 
  </code></pre>
  
  <p>And if it can not be installed, the whole application can not be started. I tried all the answers from <a href="https://stackoverflow.com/questions/9050419/cant-install-rmagick-2-13-1-cant-find-magickwand-h">here</a>, and none of them works on MacOS :-( I reinstalled imagemagick and pkg-config with homebrew, and tried various version of RMagick without success. 2.16.0 is the latest version of <a href="https://rubygems.org/gems/rmagick" rel="noreferrer">RMagick</a> currently. </p>
  
  <p>MagicWand seems to be used in ImageMagick version > 6.9, and it can be found on the machine: </p>
  
  <pre><code>find /usr/local -name MagickWand.h
  =&gt; /usr/local/Cellar/imagemagick/6.9.5-9_1/include/ImageMagick-6/wand/MagickWand.h
  
  find /usr/local -name MagickWand.pc
  =&gt; /usr/local/Cellar/imagemagick/6.9.5-9_1/lib/pkgconfig/MagickCore.pc
  </code></pre>
  
  <p>It does not work even if I specifiy the these paths during the gem install (same error as above) :-(</p>
  
  <pre><code>C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.5-9_1/include/ImageMagick-6 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig gem install rmagick
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>The error only occurs for Ruby 1.8.7, it is possible to install RMagick for Ruby 2.0 and Ruby 2.3. Ruby 1.8.7 and ImageMagick 6.9.5 do not seem to be compatible.</p>
  
  <ul>
  <li>Ruby 1.8.7 x</li>
  <li>Ruby 2.0.0 ✓ </li>
  <li>Ruby 2.3.1 ✓ </li>
  </ul>