开发者

Why am I having a problem installing rmagick

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 /Librar开发者_StackOverflow中文版y/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


on Ubuntu/Debian you would need to install:

sudo apt-get install libmagickwand-dev

on RedHat/Fedora/CentOS:

yum install ImageMagick-devel


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


On fedora make sure you have ImageMagick-devel installed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜