ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config

Viewed 43669

I used a script to install ImageMagick http://github.com/masterkain/ImageMagick-sl

After a while, I got ImageMagick installed.

Then I ran sudo gem install rmagick and got

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in...

I'm working in OSX Snow Leopard with Ruby 1.9.2 and Rails 3. Any ideas?

12 Answers

I believe you need the Imagemagick libraries.

If you are using Homebrew (which I'd highly recommend), simply do

$ brew install imagemagick

Then rerun bundle install

On CentOS 5.7, I got it to work by first specifying PKG_CONFIG_PATH:

export PKG_CONFIG_PATH=/usr/local/src/ImageMagick-6.7.5-10/magick/

gem install rmagick

After several days of searching, my problema was related to some missing libraries, and the one that get the gem installed was this one:

brew install pkg-config

after this I did my bundle install again and it worked.

Related