2013-04-18 45 views
3

與其他許多人一樣,我在運行軟件包安裝時在Ubuntu上安裝rmagick時遇到問題。Ubuntu 12.10 - Ruby gem rmagick缺失依賴項問題

我上捆綁這種錯誤安裝命令:

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/[email protected]/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. 

然後我做了一些搜索和發現添加缺少庫的一些建議:

命令和apt-get安裝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 

命令和apt-get安裝實: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. 

命令和apt-get安裝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. 

命令和apt-get安裝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. 

命令和apt-get安裝libmagick ++ - 開發:

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. 

似乎任何嘗試安裝正確的軟件包都會遇到這個問題。

我剛剛看到一篇關於從源代碼安裝imagemagick的文章,所以我會試試,但如果任何人有任何更好的想法,我很樂意聽到他們。

感謝

+0

它不會直接解決您的問題,但一旦你用'捆綁install'問題,這是值得回落至'寶石install'爲具體問題寶石。它稍微快一點,有時候行爲不同,足以讓你更好地瞭解問題。一旦解決,你可以再次回到'捆綁安裝'你的項目。 –

回答

8

我只是想在我的筆記本電腦(Ubuntu的13.04)。

gem install rmagick 

也失敗了。然後,我做了

sudo apt-get install libmagick++-dev 

和rmagick安裝沒有問題。

+0

謝謝你試圖幫助菲利普,但不幸的是,這也給了我依賴的錯誤。我會將它添加到列表中。 –

+0

@eb_dev:我設法複製OP中的原始錯誤,在Ubuntu 12.10系統(服務器版本,無GUI)和Ruby 1.8.7-p371上,然後執行'sudo apt-get install libmagick ++ - dev'和rmagick爲我安裝。如果你還沒有更新一段時間,我覺得值得在'sudo apt-get update'後再試一次。 。 。 –

+0

Hrm ok。我無法重現這個問題。但看看這個askubuntu頁面:http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies 它給出了未解決的依賴性問題的很多可能的解決方案。 – tessi

9

我找到了解決辦法:

sudo apt-get install aptitude 

然後火:

sudo aptitude install graphicsmagick-libmagick-dev-compat 

當記者問:

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] 

答: 「N」

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

在第二個問題:

The following actions will resolve these dependencies: 

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

答: 「Y」 或按回車

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

等待,直到任務結束;)

+0

謝謝。它適用於我:) –

+0

什麼是惡夢!謝謝。 –

5

該解決方案畢竟比所示更重要的前辯論,因爲它刪除:

graphicsmagick-libmagick-dev-compat

,但解決問題(在 '包安裝'):

checking for wand/MagickWand.h... no 

的展現在我的第二個職位類型提示:

sudo aptitude install libmagickwand-dev 

在:

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] 

答案:

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

在謝勝利:

以下操作將解決這些依賴關係:

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

答: 「Y」

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

任務完成後,U可以很容易地在你的項目目錄中運行'bundle install'

3

嘗試安裝的ImageMagick和libmagickwand-DEV在一起:

sudo apt-get install imagemagick libmagickwand-dev 

這樣容易妥善解決的依賴關係。 (在Ubuntu 12.04測試)

0
sudo apt-get install libmagick++-dev 

rmagick安裝成功