Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

Installing RMagick on macOS Sierra

February 3, 2017 by Rob Bazinet 5 Comments

Tweet

I ran into a problem recently on macOS Sierra, trying to install the RMagick ruby gem. I was using ImageMagick 7 installed via HomeBrew, with this error:

Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /Users/rbazinet/.rvm/gems/[email protected]_admin/gems/rmagick-2.16.0/ext/RMagick
/Users/rbazinet/.rvm/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20170203-49311-bi1omy.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-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... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.16.0. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/rbazinet/.rvm/rubies/ruby-2.3.1/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/rbazinet/.rvm/gems/[email protected]_admin/extensions/x86_64-darwin-15/2.3.0/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1

After a bit of trying to install the gem by setting the C_INCLUDE_PATH to the location of the MagickWand.h file, the gem could still not be installed. A Google search revealed the solution. It seems the RMagick gem (v 2.16.0 as of this writing) is not compatible with ImageMagick 7.

The StackOverflow articles points outthe necessary steps to get it to work:

Install version 6 (uninstall existing imagemagick if needed):

brew install [email protected]

Since this is keg-only, you should then force-link it:

brew link --force [email protected]

This installed imagemagick version 6.9.7-4 for me.

Afterwards, the gem then installed successfully. I am including the version numbers for future readers:

This solution worked great and RMagick installed without having to jump through any other hoops. Hope this helps.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Ruby Tagged With: macOS Ruby RMagick ImageMagick

Recent Posts

  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur
  • RailsConf 2021 and the Future of Conferences
  • Fixing Out of Diskspace Errors on Amazon EC2

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • This is so true! I'd love to call out some companies attempting this and making life hard on devs. https://t.co/oNayiZdKlc
    about 1 month ago
  • I’m looking for a good Mac client app to backup my Mac to my Synology NAS. Any suggestions? I’m looking for something besides Arq 7.
    about 3 months ago
  • Hotwire Course Early Access is Open https://t.co/GeW2W0HLYI
    about 4 months ago
  • The James Webb Space Telescope is an amazing engineering fest playing out in real-time - https://t.co/FlGn7LXgkY
    about 5 months ago
  • This is pretty slick - https://t.co/iYYbfNELII. Works with Edge on the Mac, but some limitations on Firefox.
    about 6 months ago
  • RSS - Posts
  • RSS - Comments
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.