我在尝试安装rmagick gem时遇到OS X Maverick的问题。以下是一些细节
ImageMagic详细信息
mairs-MacBook-Pro:social-login-in-rails umair$ convert --version
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg ltdl lzma png xml zlib
我尝试使用和不使用路径安装,但我无法安装rmagick。 安装rmagick
时出错Umairs-MacBook-Pro:social-login-in-rails umair$ sudo C_INCLUDE_PATH=/opt/ImageMagick/include/ImageMagick-6/ PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig/ gem install rmagick
Building native extensions. This could take a while...
/Users/umair/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr in PATH, mode 040777
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/umair/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/local/bin/Magick-config reports version 6.8.9 Q16 is installed in /usr/local/Cellar/imagemagick/6.8.9-1
/opt/ImageMagick/bin/Magick-config reports version 6.8.8 Q16 is installed in /opt/ImageMagick
Using 6.8.9 Q16 from /usr/local/Cellar/imagemagick/6.8.9-1.
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
/usr/local/bin/Magick-config: line 41: pkg-config: command not found
/usr/local/bin/Magick-config: line 47: pkg-config: command not found
/usr/local/bin/Magick-config: line 50: pkg-config: command not found
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
/usr/local/bin/Magick-config: line 53: pkg-config: command not found
Can't install RMagick 2.13.2. 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/umair/.rvm/rubies/ruby-2.1.0/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /Users/umair/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/rmagick-2.13.2 for inspection.
Results logged to /Users/umair/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/rmagick-2.13.2/gem_make.out
答案 0 :(得分:3)
对于在OSX Sierra上遇到此问题的人,自制安装imagemagick版本7 +
您需要安装imagemagick的第6版才能使rmagick正常工作。这三个命令对我有用。安装imagemagick的第6版,然后强制它链接。捆绑安装rmagick之后应该正常工作。
$ brew install imagemagick@6
$ brew link imagemagick@6 --force
$ bundle install
在安装和链接到@ 6之前,您可能需要brew uninstall imagemagick
。
答案 1 :(得分:1)
我遇到了完全相同的问题,并在命令行上运行这些问题(使用mac):
$ brew uninstall pkg-config
$ brew install pkg-config
$ brew unlink pkg-config && brew link pkg-config
答案 2 :(得分:0)
要彻底安装imagemagick@6
rmagic 2.16
,您需要运行:
$ brew uninstall imagemagick
$ brew install imagemagick@6 && brew link imagemagic@6 --force
$ brew install pkg-config
然后,您可以毫无问题地运行bundle install
。