Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Ruby / Installing RMagick on macOS Sierra

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

Related

Filed Under: Ruby Tagged With: macOS Ruby RMagick ImageMagick

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Recent Posts

  • Status Bar in iTerm2
  • Supporting Multiple SSH Keys on macOS
  • Using the Microsoft Ergonomic Keyboard on macOS
  • 10 Steps to Survive Working from Home
  • “Are you building a business or learning a stack?”

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Ruby on Rails Creator Takes on JavaScript Frameworks with Hotwire - https://t.co/cToSABdzbC
    about 3 weeks ago
  • The 2nd annual State of Independent SaaS from @MicroConf report is almost ready. Join us for a live stream on 2/10… https://t.co/zjkFYSmg5B
    about 3 weeks 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.