66

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?

teecraft
  • 927
  • 2
  • 9
  • 10
  • Possible duplicate of [rmagick gem install "Can't find Magick-config"](http://stackoverflow.com/questions/5201689/rmagick-gem-install-cant-find-magick-config) – Amir Ali Akbari Apr 25 '17 at 08:45

12 Answers12

107

I was getting the same error and it got resolved after installing the libmagick9-dev library on ubuntu 11.



Update (Thanks to the commenters - Dec. 2012)

$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install graphicsmagick-libmagick-dev-compat for ubuntu 12

$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install libmagick9-dev for ubuntu 11 or below.

$ yum install ImageMagick-devel for centos

$ brew install imagemagick for Mac OS (using Homebrew)

eaykin
  • 3,473
  • 1
  • 32
  • 31
55

you need the imagemagick libraries under ubuntu

$ sudo apt-get install libmagickwand-dev

it contains all missing libraires

then run bundle install command

jane
  • 345
  • 2
  • 12
antiqe
  • 1,129
  • 8
  • 17
25

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

Nic Aitch
  • 628
  • 8
  • 14
  • this did it for me. thank you thank you, id been trying various ways for hours – 29er May 15 '12 at 02:31
  • 5
    Did not fixed for me. Installation lacks: checking for InitializeMagick() in -lMagickCore... no; -lMagick... no; -lMagick++... no – sadfuzzy Dec 18 '12 at 00:01
  • Sadfuzzy I have the same problem, find a solution? – alt Dec 25 '12 at 09:53
  • sadfuzzy and Jackson Gariety, same problem here too. Any solution? – sincospi Dec 26 '12 at 20:20
  • 5
    @sincospi RMagick expects for Homebrew to provide certain symlinks which don't exist. You can run [this gist](https://gist.github.com/4583529) to create the symlinks specific to your ImageMagick installation that are needed for RMagick to work. – fny Jan 21 '13 at 04:29
8

Mac OS Mountain Loin (using Homebrew)

  1. download and install http://xquartz.macosforge.org/trac/wiki/X112.7.2
  2. brew install imagemagick
  3. gem install rmagick
Nedudi
  • 4,814
  • 2
  • 35
  • 31
3
sudo apt-get install libmagickwand-dev 

works well for Ubuntu 12.10

This is assuming you have installed all other dependencies viz.

sudo apt-get install imagemagick ruby ruby-dev gem`
ajayv
  • 31
  • 1
2

For those who got

InitializeMagick() in -lMagickCore... no; -lMagick... no; -lMagick++... no;

this worked for me in OS X 10.8: https://github.com/maddox/magick-installer

From here: RVM + Ruby 1.9.2 + Rmagick + Lion = System Works, RVM Doesn't

Community
  • 1
  • 1
fsamuel.bs
  • 21
  • 3
2

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
praseodym
  • 2,074
  • 15
  • 27
Bjer
  • 99
  • 1
  • 2
0

Initially, I came around to installing rmagick because it seemed to be a dependency when I tried installing libgtk2.0-dev. I was trying to install that package, because the RGtk2.0 is a requirement for using R package called rattle.

Anyway, none of the above solutions worked for me in installing in my Ubuntu 12.04. Even running sudo apt-get update first didn't seem to help, nor this related posting: Installing rmagick on Ubuntu

I eventually found what works is to troubleshoot using sudo aptitude rather than apt-get. https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages

I recommend the technique of using aptitude to work through the package installation issue.

Community
  • 1
  • 1
David Kim
  • 856
  • 9
  • 11
0

On Mac Os X, check if /opt/local/bin is in your PATH. If not:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo gem install rmagick

This worked for me!

0

I had an issue installing Rmagick gem version 2.13.2 on Debian Jessie. After fighting with the packages in the other answers, I upgraded the version of the Rmagick gem from 2.13.2 to the latest (2.16.0 at time of writing). This installed successfully.

bundle update rmagick
Ben Simpson
  • 3,863
  • 1
  • 15
  • 10
0

If you tried all solutions, of all posts of whole Internet, have installed and reinstalled many times all indicated packages in all Linux or Mac distributions/versions (even in Windows) and it still not working, close your terminal and open it again. Some times, even if your reload all shell environment, only after I reopen the terminal the bundle install was successfully completed.

Fernando Kosh
  • 3,170
  • 1
  • 29
  • 25
0

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.