关于rails上的ruby:无法安装RMagick gem

Cannot install RMagic gem

我想安装RMagic gem,我得到了"找不到Magick-config",所以我安装了

1
 $ sudo apt-get install libmagickwand-dev

但现在我得到以下输出:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby -r
./siteconf20150526-12203-xr9xf7.rb extconf.rb checking for Ruby
version >= 1.8.5... yes checking for gcc... yes checking for
Magick-config... yes checking for ImageMagick version >= 6.4.9... *
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=/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby extconf.rb:154:in ``': No such file or directory - convert
(Errno::ENOENT)
from extconf.rb:154:in block in

'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:918:inblock
in checking_for'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:351:in block
(2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:321:in
open'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:351:in block
in postpone'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:321:in
open'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:347:in
postpone'
from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mkmf.rb:917:in
checking_for'
from extconf.rb:151:in `'

extconf failed, exit code 1

Gem files will remain installed in
/usr/local/rvm/gems/ruby-2.1.5@rails4/gems/rmagick-2.13.4 for
inspection. Results logged to
/usr/local/rvm/gems/ruby-2.1.5@rails4/extensions/x86_64-linux/2.1.0/rmagick-2.13.4/gem_make.out

有人可以帮我解决吗?


看看它失败的地方(这很难解决,因为你的新行被吞噬了):

1
checking for ImageMagick version >= 6.4.9... * extconf.rb failed *

这个检查没有得到"是",这表明你安装的libmagickwand-dev包没有提供ImageMagic> = 6.4.9的版本,这显然是rmagick gem版本2.13.4所需的版本。

要么获得更新的ImageMagick或更旧的rmagick gem。


确保安装ImageMagick。 通常,没有正确的依赖是罪魁祸首。

http://www.imagemagick.org/script/install-source.php


在尝试上述解决方案后仍然无法工作..我试过这一个
sudo apt-get install graphicsmagick-libmagick-dev-compat
为我做了诀窍