本文介绍了无法在Ubuntu 13.04上安装rmagick gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装rmagic时:

When I try to install rmagic with:

gem install rmagic

它给出错误:

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

    /home/biske/.rbenv/versions/2.0.0-p247/bin/ruby 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... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.2. Can't find MagickWand.h.
*** 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=/home/biske/.rbenv/versions/2.0.0-p247/bin/ruby


Gem files will remain installed in /home/biske/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2 for inspection.
Results logged to /home/biske/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

我试图搜索问题,发现我缺少libmagickwand-dev。我尝试安装它:

I tried to search for problem and found that I am missing libmagickwand-dev. I tried to install it with:

sudo apt-get install libmagickwand-dev

但它会引发错误:

The following packages have unmet dependencies:
 libmagickwand-dev : Depends: libmagickcore-dev (= 8:6.7.7.10-5ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

如果我尝试安装它:

sudo apt-get install libmagickcore-dev

它给出了错误:

The following packages have unmet dependencies:
 libmagickcore-dev : Depends: librsvg2-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

如果我尝试安装它:

sudo apt-get install librsvg2-dev

它给出了错误:

The following packages have unmet dependencies:
 librsvg2-dev : Depends: libglib2.0-dev (>= 2.24.0) but it is not going to be installed
                Depends: libgdk-pixbuf2.0-dev (>= 2.23.5-2) but it is not going to be installed
                Depends: libcairo2-dev (>= 1.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

如果我尝试使用以下命令安装libglib2.0-dev:

If I try to install libglib2.0-dev with:

sudo apt-get install libglib2.0-dev

它给出错误:

The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.36.0-1ubuntu1) but 2.36.0-1ubuntu2 is to be installed
                  Depends: libglib2.0-bin (= 2.36.0-1ubuntu1)
E: Unable to correct problems, you have held broken packages.

如果我安装了libglib2.0-0:

If I install libglib2.0-0 with:

sudo apt-get install libglib2.0-0



it gives:

libglib2.0-0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

如果我安装了libglib2.0-bin:

If I install libglib2.0-bin with:

sudo apt-get install libglib2.0-bin

它给出:

Reading package lists... Done
Building dependency tree
Reading state information... Done
libglib2.0-bin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

这两个库已经安装但是再次发布:

Those 2 libs are installed but issuing again:

sudo apt-get install libglib2.0-dev

它给出了同样的错误:

The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.36.0-1ubuntu1) but 2.36.0-1ubuntu2 is to be installed
                  Depends: libglib2.0-bin (= 2.36.0-1ubuntu1)
E: Unable to correct problems, you have held broken packages.

这里有什么问题?

我正在使用Ubuntu 13.04,rbenv,ruby 2.0.0,如果这很重要。

I am using Ubuntu 13.04, rbenv, ruby 2.0.0, if that matters.

推荐答案

解决方案是在这些库中添加ppa可以找到。

Solution is to add ppa where those libs could be found.

添加PPA:

sudo add-apt-repository ppa:ricotz/testing

然后更新包列表:

sudo apt-get update

最后安装它:

sudo apt-get install libmagickwand-dev

这篇关于无法在Ubuntu 13.04上安装rmagick gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 01:06