9

I followed the installation of RMagick for OSX: http://rmagick.rubyforge.org/install-faq.html#osx

I have done the Imagemagick installation from John Maddux (solution to install ImageMagick on OSX without using MacPorts)

Here's my terminal window:

Suebphatt:~ suebphattleelertphong$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Suebphatt:~ suebphattleelertphong$ rails -v
Rails 3.0.3

Suebphatt:~ suebphattleelertphong$ gem -v
1.3.7

Suebphatt:~ suebphattleelertphong$ gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for     inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Suebphatt:~ suebphattleelertphong$ 

Thanks a lot for help, Suebphatt

howdy
  • 127
  • 1
  • 2
  • 8

3 Answers3

29

I would strongly recommend you try homebrew, which is a great replacement for macports:

Once you get homebrew installed, you should be able to install imagemagick and rmagick very easily:

brew install imagemagick     # will take a while!
gem install rmagick

More info here:

http://www.codedrop.ca/blog/archives/214

and here:

http://weblogs.manas.com.ar/mverzilli/2010/05/19/install-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in-the-painless-way-with-homebrewinstall-the-rmagick-gem-in/

UPDATE: (thanks to JJD and this answer)

Try to install without openpmp if you are having trouble with a chiliproject install:

brew install imagemagick --disable-openmp

UPDATE X2: (thanks to Ramon Araujo's comment)

If you have previously installed imagemagick with homebrew, you will have to unlink it before you install again:

brew unlink imagemagick
Community
  • 1
  • 1
bowsersenior
  • 12,524
  • 2
  • 46
  • 52
  • Hi, bowsersenior, Thank you for the suggestion. I'll try it and will let you know the result. – howdy Nov 27 '10 at 11:55
  • I tried to install [chiliproject](https://www.chiliproject.org) and successfully followed this advise to [install imagemagick without openmp](http://stackoverflow.com/a/7973760/356895). – JJD May 21 '12 at 12:23
  • @JJD Thanks for the comment. I've updated my answer with your info. – bowsersenior May 27 '12 at 18:12
  • 1
    Perfect, just one comment. I had imagemagick already installed using brew, so it asked me first to 'brew unlink imagemagick' before. After I did that, then I followed again your suggestions and it all went perfect! Thanks @bowsersenior. – Ramon Araujo Oct 26 '12 at 05:31
  • Thanks @RamonAraujo, I have updated my answer with that info. – bowsersenior Oct 26 '12 at 23:28
  • Updated my answer to include link to `brew.sh` – bowsersenior Jun 29 '13 at 03:16
8

Another think to watch out is the version of imagemagick. I had ImageMagick version 6.8.0, which is the latest if you install from homebrew, and rmagick just does not compile with this version. So do a

convert --version

and make sure that your ImageMagick is 6.7 or less otherwise rmagick wont compile..

Arthur Neves
  • 11,840
  • 8
  • 60
  • 73
0

Struggled with this problem for a while, and the fix below (copied from this SO answer solved the issue (specifically the section about symbolic links).

rmagick has a problem working with imagemagick (>= 6.8.0-10) from homebrew.

You can either

update rmagick gem by

bundle update rmagick

or manually symbol link some dylib to make it work:

$ cd "`Magick-config --prefix`lib"
$ ln -s libMagick++-Q16.7.dylib   libMagick++.dylib
$ ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
$ ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib

After that gem install rmagick should work.

Check the discussion about this in https://github.com/Homebrew/homebrew/issues/16625

Community
  • 1
  • 1
Phil
  • 2,732
  • 19
  • 20