简体   繁体   English

无法在Ubuntu 13.04上安装rmagick gem

[英]Can't install rmagick gem on Ubuntu 13.04

When I try to install rmagic with: 当我尝试使用以下方法安装rmagic时:

gem install rmagic

it gives error: 它给出了错误:

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

I tried to search for problem and found that I am missing libmagickwand-dev. 我试图搜索问题,发现我缺少libmagickwand-dev。 I tried to install it with: 我尝试用以下方法安装它:

sudo apt-get install libmagickwand-dev

but it raises error: 但这会引发错误:

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.

If I try to install it with: 如果我尝试通过以下方式安装它:

sudo apt-get install libmagickcore-dev

it gives error: 它给出了错误:

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.

If I try to install it with: 如果我尝试通过以下方式安装它:

sudo apt-get install librsvg2-dev

it gives error: 它给出了错误:

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.

If I try to install libglib2.0-dev with: 如果我尝试使用以下命令安装libglib2.0-dev:

sudo apt-get install libglib2.0-dev

it gives error: 它给出了错误:

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.

If I install libglib2.0-0 with: 如果我使用以下命令安装libglib2.0-0:

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.

If I install libglib2.0-bin with: 如果我使用以下命令安装libglib2.0-bin:

sudo apt-get install libglib2.0-bin

it gives: 它给:

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

it gives same error: 它给出了相同的错误:

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.

What could be problem here? 这可能是什么问题?

I am using Ubuntu 13.04, rbenv, ruby 2.0.0, if that matters. 我正在使用Ubuntu 13.04,rbenv,ruby 2.0.0,如果那很重要的话。

try this out 试试这个

first install imagemagick 首先安装imagemagick

sudo apt-get install imagemagick

and then 然后

sudo apt-get install libmagickwand-dev

Solution is to add ppa where those libs could be found. 解决方案是在可以找到这些库的地方添加ppa。

Add PPA: 添加PPA:

sudo add-apt-repository ppa:ricotz/testing

Then update package list: 然后更新软件包列表:

sudo apt-get update

Finally install it with: 最后安装:

sudo apt-get install libmagickwand-dev

Try clearing your apt repository and removing any broken packages first: 尝试清除您的apt信息库并首先删除任何损坏的软件包:

sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

If the system identifies any broken packages, forcefully remove them (replace package_name with your own): 如果系统识别出任何损坏的软件包,请强行删除它们(用您自己的package_name替换):

sudo dpkg --remove -force --force-remove-reinstreq package_name

Then reinstall any missing packages again. 然后再次重新安装所有缺少的软件包。

您只需要安装:

sudo apt-get install libmagickwand-dev

Here is the good example on this blog 这是此博客上的好例子

The below command will solve your problem. 下面的命令将解决您的问题。 It helped me to install rmagick . 它帮助我安装了rmagick

sudo apt-get install libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev

This worked for me: 这为我工作:

  1. sudo apt-get install libcairo2=1.14.6-1 --reinstall sudo apt-get install libcairo2 = 1.14.6-1-重新安装
  2. sudo apt-get install libmagickwand-dev 须藤apt-get install libmagickwand-dev
  3. sudo gem install rmagick 须藤宝石安装rmagick

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM