2011-11-04 115 views
3

我已經在全新安裝的OS X Lion上通過RVM安裝了Ruby 1.9.2。我已經通過自制軟件安裝了ghostscript和imagemagick,並且在使用RVM運行gem install rmagick時失敗。在ruby的系統安裝中使用gem install rmagick時,它工作得很好。RVM + Ruby 1.9.2 + Rmagick + Lion = System Works,RVM不是

這是時產生的錯誤:

[email protected] ~/.rvm/gems/ruby-1.9.2-p290/cache ‹ruby-1.8.7› 
╰─$ gem install rmagick                                                             1 ↵ 
Building native extensions. This could take a while... 
ERROR: Error installing rmagick: 
    ERROR: Failed to build gem native extension. 

     /Users/wedtm/.rvm/rubies/ruby-1.8.7-p352/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes 
checking for clang... yes 
checking for Magick-config... yes 
checking for ImageMagick version >= 6.4.9... yes 
checking for HDRI disabled version of ImageMagick... yes 
checking for stdint.h... yes 
checking for sys/types.h... yes 
checking for wand/MagickWand.h... yes 
checking for InitializeMagick() in -lMagickCore... no 
checking for InitializeMagick() in -lMagick... no 
checking for InitializeMagick() in -lMagick++... no 
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information. 

*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/Users/wedtm/.rvm/rubies/ruby-1.8.7-p352/bin/ruby 
    --with-MagickCorelib 
    --without-MagickCorelib 
    --with-Magicklib 
    --without-Magicklib 
    --with-Magick++lib 
    --without-Magick++lib 


Gem files will remain installed in /Users/wedtm/.rvm/gems/ruby-1.8.7-p352/gems/rmagick-2.13.1 for inspection. 
Results logged to /Users/wedtm/.rvm/gems/ruby-1.8.7-p352/gems/rmagick-2.13.1/ext/RMagick/gem_make.out 

可能是什麼造成的?有關如何讓RVM看到imagemagick的想法應該如何?

回答

8

magick-installer腳本(https://github.com/maddox/magick-installer)在Mac上安裝ImageMagick的功能非常出色。當我不使用此腳本進行安裝時,安裝似乎會成功,但該gem永遠無法找到安裝。

使用此腳本,我成功安裝了之前多次失敗的安裝。祝你好運:)

+0

這是否解決了你的問題? – michaelward82

+0

不知道爲什麼,但這個伎倆。至少直到下次我遇到Rails和ImageMagick的一些問題... –

+0

哇,真棒!這幫了我很大的時間。我曾嘗試用Brew安裝ImageMagick,但從未能夠安裝Rmagick。這個伎倆。一個問題:如何在使用此方法安裝ImageMagick後卸載ImageMagick? –