RMagick installation: Can't find MagickWand.h

install rmagick mac
an error occurred while installing rmagick (2.16.0), and bundler cannot continue.
error installing rmagick: error: failed to build gem native extension.
install imagemagick
install imagemagick mac
imagemagick@6
rmagick exif
rmagick imagemagick 7

Updating RMagick and Imagemagick 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 6.9.5-9

$ convert --version
Version: ImageMagick 6.9.5-9 Q16 x86_64 2016-09-09

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

$ 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 (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
checking for Ruby version >= 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. 

And if it can not be installed, the whole application can not be started. I tried all the answers from here, 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 RMagick currently.

MagicWand seems to be used in ImageMagick version > 6.9, and it can be found on the machine:

find /usr/local -name MagickWand.h
=> /usr/local/Cellar/imagemagick/6.9.5-9_1/include/ImageMagick-6/wand/MagickWand.h

find /usr/local -name MagickWand.pc
=> /usr/local/Cellar/imagemagick/6.9.5-9_1/lib/pkgconfig/MagickCore.pc

It does not work even if I specifiy the these paths during the gem install (same error as above) :-(

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

UPDATE:

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.

  • Ruby 1.8.7 x
  • Ruby 2.0.0 ✓
  • Ruby 2.3.1 ✓

To solve the issue in Mac OSX Sierra, High Sierra, El Capitan, Mojave, and Catalina, you can do the following:

brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force

imagemagick@6 is keg-only, so you'll need to force linking.

HowTo install rmagick gem on Windows, Building native extensions. This could take a whileERROR: Error installing rmagick:ERROR: Failed to build gem native extension.current  RMagick depends on an outdated version of imagemagick, version 6. (see below) Homebrew offers this as a keg-only package, which you can install with: brew install imagemagick@6

I had this same issue with ImageMagick 7.0.4-4. The proper fix is to install imagemagick@6. I found https://github.com/Homebrew/homebrew-core/pull/8756 useful if you accidentally deleted your imagemagick@6 or never had it installed in the first place.

Installing Rmagick on OSX High Sierra, You should then be able to install the Rmagick Gem. sudo apt-get install imagemagick libmagickwand-dev. If not, you This could take a while. RMagick is implemented in the Magick module, therefore its constants are in the Magick namespace. However, for clarity I've omitted the Magick:: prefix in most places in this document. You can use the include Magick statement to add the constants and methods to the Object namespace.

macOs Sierra:

brew uninstall imagemagick
brew install imagemagick@6
brew link imagemagick@6 --force

Installing rmagick on Ubuntu, Type “convert — version” in CMD to test ImageMagick's installation. This will verify ImageMagick is installed (can be referenced by RMagick). Development Setup 1) set up the Vagrant environment. If you don't already have Vagrant installed, you can download and install it from 2) clone RMagick and log in to the vagrant box. 3) install ImageMagick and additional environment stuff. 4) build RMagick. This compiles the RMagick extensions

First of all unlink your installed imagemagick which was not properly installed in latest mac high sierra by using.

brew unlink imagemagick

then install latest imagemagic6 using below command

brew install imagemagick@6 && brew link imagemagick@6 --force

Then install gem rmagick using below command

gem install rmagick 

It will work perfectly fine.

How To Install The RMagick #RubyOnRails Gem on Windows 7/8/10 , Can't install RMagick. Can't find libMagick or one of the dependent libraries. Check the mkmf.log file for more detailed  @cesc1989 It seems RMagick can't find an ImageMagick installation. Can you verify which version of ImageMagick you have installed with convert --version or identify --version? Also, please note, RMagick 4.0 and before do not support ImageMagick >= 7. If you have ImageMagick 7, you can try our 4.1.0.rc2 gem. 👍

yah this one solves my issue:

MacOS X Sierra:

brew uninstall imagemagick
brew install imagemagick@6
brew link imagemagick@6 --force

File: README, However, that installation may not work for Rails systems that you do not run through Locomotive. This script will install ImageMagick and all prerequisites. Things that can go wrong. The RMagick installation FAQ has answers to the most commonly reported problems, though may be out of date. Can't install RMagick. Can't find libMagick or one of the dependent libraries. Check the mkmf.log file for more detailed information

Professional Ruby on Rails, Windows Windows developers actually have the easiest solution for installing and configuring ImageMagick and RMagick, as they can utilize a gem that  When I did install the RMagick normally it actually did not appeared as enabled feature in Redmine admin/info. So after I decided to test RMagick under Redmine directory: ruby script/console >> require 'RMagick' Right there (after require) some people might have been experienced one single problem, that prevented RMagick to load:

Practical Rails Projects, RMagick is a binding from Ruby to the ImageMagick TM image manipulation library. Please remember I can't help with Ruby or ImageMagick installation and  Development Setup 1) set up the Vagrant environment. If you don’t already have Vagrant installed, you can download and install it from 2) clone RMagick and log in to the vagrant box. 3) install ImageMagick and additional environment stuff. 4) build RMagick. This compiles the RMagick extensions

RMagick 2.12.0 User's Guide and Reference, configure ~/RMagick-x.x.x]$ make ~/RMagick-x.x.x]$ sudo make install RMagick is blog or small business application, you will quickly outgrow Locomotive. RMagick installation: Can't find MagickWand.h (14) Updating RMagick and Imagemagick 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 6.9.5-9

Comments
  • stackoverflow.com/questions/41647979/…
  • Had to unlink manually brew unlink imagemagick before link - but it worked. Thanks a lot.
  • Wow. Super sucks that I can't have the latest version of ImageMagick, but this works. Thanks!
  • Works perfectly with Ubuntu Ubuntu 16.04.3 LTS
  • WOW! Thank you so much for that link. I was wasted almost half of my work-day trying to fix this.
  • Note that imagemagick@6 is keg-only so you'll need to force linking. brew install imagemagick@6 && brew link imagemagick@6 --force solved it for me
  • Awesome, cheers! This worked for me: brew install --force imagemagick@6 && brew link imagemagick@6 --force
  • Yes, installing the previous version (6x) would definitely fix it. The issue is that the folder structure of the imagemagick files have change in the 7x version. And while installing the gem it is assuming the folder structure that 6x has
  • Rolling back to imagemagick@6 doesn't work for me unfortunately. Even after reinstalling and relinking I still get this message when trying to install rmagick: Using 6.9.8 Q16 from /usr/local/Cellar/imagemagick@6/6.9.8-3. checking for outdated ImageMagick version (<= 6.4.9)... yes checking for Ruby version >= 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.15.0. Can't find MagickWand.h.
  • -1 because you force link for no reason nor telling anyone why this is a bad idea to begin with. See my answer for doing it "properly" in the sense of Homebrew and not MacPorts.
  • Worked for me: Mac OS 10.12.X. I installed ImageMagick 7 first and had problems with installing the rails gem rmagick.
  • Could you find any solutions? I'm experiencing same issues with you.
  • as I said. switching back to imagemagick 6.9 fixes it for me.
  • Thanks, I got that and fixed it, according to your suggestion. But what I was trying to ask if you have solved it using latest ImageMagick version? Then I found the related issue github.com/rmagick/rmagick/issues/256 which also suggesting to downgrade ImageMagick as you did. So thanks again.