rmagick gem install "Can't find Magick-config"

When building native Ruby gems, sometimes you'll get an error containing "ruby extconf.rb". This is often caused by missing development libraries for the gem you're installing, or even Ruby itself.

Do you have apt installed on your machine? If not, I'd recommend installing it, because it's a quick and easy way to get a lot of development libraries.

If you see people suggest installing "libmagick9-dev", that's an apt package that you'd install with:

$ sudo apt-get install libmagickwand-dev imagemagick

or on centOs:

$ yum install ImageMagick-devel

On Mac OS, you can use Homebrew:

$ brew install imagemagick

The new correct way is to install libmagickwand-dev:

sudo apt-get install libmagickwand-dev

Then you should be able to install rmagick no problem.


imagemagick@6 works for me!

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

See this thread