我已经阅读了很多关于在OS X上安装rmagick gem的问题的帖子,但是没有为MagickCore设置PATH序列的解决方案似乎对我有用。在尝试安装gem时,我不断提出相同的堆栈跟踪。
这是我每次都得到的,而我对如何克服它感到茫然。
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/ruby-1.9.3-p194@recruittalk/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/mwallace/.rvm/gems/ruby-1.9.3-p194@recruittalk/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 :(得分: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来反映它的依赖性的变化(它已经陈旧了一两年)。但我自己也不了解这一点。
答案 1 :(得分:0)
我建议切换到mini_magick gem。您可以获得ImageMagick提供的所有功能,但安装更容易,内存占用更少。