简体   繁体   English

Ubuntu 12.10 - Ruby gem rmagick缺少依赖性问题

[英]Ubuntu 12.10 - Ruby gem rmagick missing dependency issue

Like many others I'm having trouble installing rmagick on Ubuntu when running bundle install. 像许多其他人一样,我在运行bundle install时在Ubuntu上安装rmagick时遇到了麻烦。

I get this error on the bundle install command: 我在bundle install命令上遇到这个错误:

Installing rmagick (2.13.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.8.7-p371/bin:/usr/local/rvm/gems/ruby-1.8.7-p371@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p371/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

*** 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-1.8.7-p371/bin/ruby


Gem files will remain installed in /home/selfsale/.bundler/tmp/2908/gems/rmagick-2.13.1 for inspection.
Results logged to /home/selfsale/.bundler/tmp/2908/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.

I then did some searching and found some suggestions for adding the missing libs: 然后我做了一些搜索,并找到了一些添加缺少的库的建议:

sudo apt-get install libmagick9-dev: sudo apt-get install libmagick9-dev:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libmagick9-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  graphicsmagick-libmagick-dev-compat

E: Package 'libmagick9-dev' has no installation candidate

sudo apt-get install graphicsmagick-libmagick-dev-compat: sudo apt-get install graphicsmagick-libmagick-dev-compat:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 graphicsmagick-libmagick-dev-compat : Depends: libgraphicsmagick1-dev but it is not going to be installed
                                       Depends: libgraphicsmagick++1-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install libmagickwand-dev: sudo apt-get install libmagickwand-dev:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

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

sudo apt-get install libmagickcore-dev: sudo apt-get install libmagickcore-dev:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

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

sudo apt-get install libmagick++-dev: sudo apt-get install libmagick ++ - dev:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

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

It seems that any attempt to install the correct packages comes up with this problem. 似乎任何安装正确软件包的尝试都会出现这个问题。

I've just seen a post about installing imagemagick from source so I'm going to try that, but if anyone has any better ideas I'd love to hear them. 我刚看到一篇关于从源代码安装imagemagick的帖子,所以我打算尝试一下,但如果有人有任何更好的想法,我很乐意听到它们。

Thanks 谢谢

I found the solution: 我找到了解决方案:

sudo apt-get install aptitude

Then fire: 然后火:

sudo aptitude install graphicsmagick-libmagick-dev-compat

When asked: 当被问到时:

The following actions will resolve these dependencies:
 Keep the following packages at their current version
1)     graphicsmagick-libmagick-dev-compat [Not Installed]
2)     libexif-dev [Not Installed]
3)     libgraphicsmagick++1-dev [Not Installed]
4)     libgraphicsmagick1-dev [Not Installed]

Answer: "n" 答案:“n”

Accept this solution? [Y/n/q/?] n

In second question: 在第二个问题:

The following actions will resolve these dependencies:

 Downgrade the following packages: 
1) libexif12 [0.6.20-2ubuntu0.1 (now) -> 0.6.20-2 (precise)] 

Answer: "Y" or hit ENTER 答案:“Y”或按ENTER键

Accept this solution? [Y/n/q/?]

Wait until task end ;) 等到任务结束;)

I just tried on my laptop (Ubuntu 13.04). 我刚刚在笔记本电脑上试过(Ubuntu 13.04)。

gem install rmagick

failed too. 也失败了。 Then I did 然后我做了

sudo apt-get install libmagick++-dev

and rmagick installed without problems. 和rmagick安装没有问题。

This solution is after all more important than shown before, cuz it removes: 毕竟这个解决方案比之前显示的更重要,因为它删除了:

graphicsmagick-libmagick-dev-compat 实:graphicsmagick-libmagick-DEV-COMPAT

but solves problem with (in 'bundle install'): 但解决了问题(在'bundle install'中):

checking for wand/MagickWand.h... no

as show in my second post type in prompt: 如我在提示中的第二个帖子类型中所示:

sudo aptitude install libmagickwand-dev

At: 在:

The following actions will resolve these dependencies:

  Keep the following packages at their current version
1)      libatk1.0-dev [Not Installed]
2)      libcairo2-dev [Not Installed]
3)      libexpat1-dev [Not Installed]
4)      libgdk-pixbuf2.0-dev [Not Installed]
5)      libglib2.0-dev [Not Installed]
6)      libgraphviz-dev [Not Installed]
7)      libgtk2.0-dev [Not Installed]
8)      libmagickcore-dev [Not Installed]
9)      libmagickwand-dev [Not Installed]
10)     libpango1.0-dev [Not Installed]
11)     librsvg2-dev [Not Installed]

Answer: 回答:

Accept this solution? [Y/n/q/?] n

In secound: 在尖锐的:

The following actions will resolve these dependencies: 以下操作将解决这些依赖关系:

  Remove the following packages: 
1 ) graphicsmagick-libmagick-dev-compat
Install the following packages:
2)libcairo-script-interpreter2 [1.10.2-6.1ubuntu2 (precise)]
[..]

Answer: "Y" 答案:“Y”

Accept this solution? [Y/n/q/?]

After task is done, U can easily run 'bundle install' in your project directory. 任务完成后,U可以轻松地在项目目录中运行'bundle install'

Try installing imagemagick and libmagickwand-dev together: 尝试一起安装imagemagick和libmagickwand-dev:

sudo apt-get install imagemagick libmagickwand-dev

This allows apt to resolve the dependencies properly. 这允许apt正确地解决依赖关系。 (tested on Ubuntu 12.04) (在Ubuntu 12.04上测试)

sudo apt-get install libmagick++-dev

rmagick安装成功

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

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