检查ImageMagick版本> = 6.4.9 ...否无法安装RMagick 2.13.4。您必须拥有ImageMagick 6.4.9或更高版本

问题描述 投票:10回答:8

我在安装rmagick时遇到问题。我正在使用ruby on rails框架开发我的项目。我在我的gemfile中包含了rmagick gem。我收到以下错误消息:

checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.

我使用brew安装了imagemagick:

 imagemagick-6.8.9-8 already installed

imagemagick文件夹位于/ usr / local / Cellar目录中

在我的终端:

Zoulfias-iMac:Myapp zoulfiahall $ rvm使用ruby-2.0.0-p481

Using /Users/zoulfiahall/.rvm/gems/ruby-2.0.0-p481
Zoulfias-iMac:Myapp zoulfiahall$ sudo gem install rmagick

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/Users/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.

*** 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/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in /Users/zoulfiahall/.rvm/rubies/
ruby-2.0.0-  p481/lib/ruby/gems/2.0.0/gems/rmagick-2.13.4 for inspection.
Results logged to /Users/zoulfiahall/.rvm/rubies/
ruby-2.0.0-  p481/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-13/
2.0.0-static/rmagick-2.13.4/gem_make.out

任何建议将被认真考虑。

imagemagick rmagick
8个回答
37
投票

这对我在ubuntu上工作。

$ sudo apt-get install imagemagick
$ sudo apt-get install libmagickwand-dev

现在再试一次。

$ bundle install

9
投票

尝试运行gem install rmagick -v 2.13.4时,我在macOS上遇到了同样的问题

这方面的技巧是rmagick安装程序(gems / rmagick-2.13.4 / ext / RMagick / extconf.rb)检查convert的输出以确定IM版本。如果没有返回正确的版本(或者完全破坏,就像我的情况一样),rmagick将无法安装。

我通过Homebrew安装了ImageMagick 6并解决了我的问题。此代码段安装IM,将其添加到您的路径,并运行明确指向IM6的安装程序。

$ brew install imagemagick@6
$ echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick -v 2.13.4

祝好运!


4
投票

我今天遇到了同样的问题。造成这个问题的原因是rmagick已经过时了。并且宝石没有定期更新。我想为那些不介意使用旧版imagemagick的人提供我的解决方案。 (我相信它高达6.5.9-10)

  1. 使用所有组件卸载imagemagick: brew uninstall --force imagemagick
  2. 通过在命令末尾添加-ruby186来安装旧版本的imagemagick brew install imagemagick-ruby186
  3. 安装rmagick :) gem install rmagick
  4. 请享用!

1
投票

刚遇到同样的问题。尝试卸载imagemagick,然后重新安装:

brew uninstall --force imagemagick
brew install imagemagick

然后安装rmagick。这对我有用。


1
投票

如果你使用brew install imagemagick @ 6安装了imagemagick

在捆绑安装之前,运行:

export LDFLAGS="-L/usr/local/opt/imagemagick@6/lib"
export CPPFLAGS="-I/usr/local/opt/imagemagick@6/include"
export PKG_CONFIG_PATH="/usr/local/opt/imagemagick@6/lib/pkgconfig"

0
投票

我在https://github.com/rmagick/rmagick/issues/126提交了类似问题的错误报告

我正在使用debian sid运行crunchbang linux。

看起来你在OSX上。如果您还没有,请考虑提交您自己的错误报告。


0
投票

下载并安装http://xquartz.macosforge.org/trac/wiki/X112.7.2

brew uninstall imagemagick
brew link xz jpeg freetype    
brew install imagemagick
brew link --overwrite imagemagick
gem install rmagick

https://stackoverflow.com/a/32055126/3563993


-1
投票
brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config
brew link pig-config

sudo gem install rmagick

这对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.