2013-01-07 76 views
3

我已經在越來越安裝在OS X,但沒有一個解決方案,用於設置PATH veriables爲rmagick寶石看了很多帖子,似乎有問題MagickCore似乎爲我工作。試圖安裝gem時,我一直提供相同的堆棧跟蹤。如何在OS安裝rmagic 2.13.1和ImageMagick的X 10.8.2

這是我每次都會得到的,而且我對如何克服這個問題感到不知所措。

Installing rmagick (2.13.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/mwallace/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes 
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config. 
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 
Package MagickCore was not found in the pkg-config search path. 
Perhaps you should add the directory containing `MagickCore.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'MagickCore' found 
Package MagickCore was not found in the pkg-config search path. 
Perhaps you should add the directory containing `MagickCore.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'MagickCore' found 
Package MagickCore was not found in the pkg-config search path. 
Perhaps you should add the directory containing `MagickCore.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'MagickCore' found 
Package MagickCore was not found in the pkg-config search path. 
Perhaps you should add the directory containing `MagickCore.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'MagickCore' found 
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/mwallace/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
    --with-MagickCorelib 
    --without-MagickCorelib 
    --with-Magicklib 
    --without-Magicklib 
    --with-Magick++lib 
    --without-Magick++lib 


Gem files will remain installed in /Users/mwallace/.rvm/gems/[email protected]/gems/rmagick-2.13.1 for inspection. 
Results logged to /Users/mwallace/.rvm/gems/[email protected]/gems/rmagick-2.13.1/ext/RMagick/gem_make.out 
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue. 
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling. 

回答

0

我遇到同樣的問題。我需要說的是,雖然我對Ruby,Rails,Homebrew(是的Unix文件結構)非常陌生......但是...

我懷疑一旦你解決了PKG_CONFIG_PATH問題,你將擁有另一個。我會提出一個快速建議,可能會或可能不適用於第一個,然後解釋我爲第二個做了什麼。

首先,我某處發現一個建議增加這.bashrc中:PKG_CONFIG_PATH = 「在/ usr/local/lib目錄/ pkgconfig」。幾個小時前我做了這個,它可能爲我解決了第一個問題。我不記得確實。

其次,我認爲ImageMagick的版本6.8已經過時需要這些方法:

checking for InitializeMagick() in -lMagickCore... no 
checking for InitializeMagick() in -lMagick... no 
checking for InitializeMagick() in -lMagick++... no 

等的早期版本仍然有他們。我在這裏遵循了一條指令(http://wearepandr.com/blog/article/homebrew-and-installing-old-package-versions)來安裝舊版本的軟件包。卸載imagemagick後,運行/ usr/local/Library/Formula /中的建議命令,然後重新安裝imagemagick,我能夠成功安裝rmagick gem。我隨機選擇了6.7.1-1種。

我真的認爲有人應該更新rmagick以反映更改它的依賴(這是陳舊的一年或兩年)。但我自己並不知情。

0

我建議切換到mini_magick寶石。您可以獲得ImageMagick提供的所有功能,但安裝更簡單,內存佔用空間稍低。