3

On Ruby 1.8.7 and rails 2.3.5 I get:

gem install rmagick

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

Building native extensions.  This could take a while...

Cynicalgrinch:levelous pawel$ 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


Gem_make.out says this:

/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
Michael Kohl
  • 66,324
  • 14
  • 138
  • 158
Simpleton
  • 6,285
  • 11
  • 53
  • 87

3 Answers3

28

on Ubuntu/Debian you would need to install:

sudo apt-get install libmagickwand-dev

on RedHat/Fedora/CentOS:

yum install ImageMagick-devel
Tombart
  • 30,520
  • 16
  • 123
  • 136
  • on windows you should have a look at gem `rmagick-win32` see http://rmagick.rubyforge.org/install-faq.html#win for more info – Tombart Oct 08 '12 at 10:35
12

To install rmagick with the gem system, you must have "imagemagick" on your system. The following error line says that rmagick failed to build because the native extension (imagemagick) does not exist on your system.

ERROR: Failed to build gem native extension.

On OSX, you can use brew (the best way in my opinion) to install imagemagick. Once brew is installed :

brew install imagemagick
gem install rmagick

On Mountain Lion (OSX), after:

brew install imagemagick

it may be necessary to force the re-creation of some symlinks manually before being able to install the rmagick gem.

> brew link -f jpeg
> brew link -f libpng
> brew link -f freetype
> brew link -f imagemagick
leviathan
  • 11,080
  • 5
  • 42
  • 40
Sandro Munda
  • 39,921
  • 24
  • 98
  • 123
0

On fedora make sure you have ImageMagick-devel installed.

Qwertie
  • 5,784
  • 12
  • 45
  • 89