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

前端之家收集整理的这篇文章主要介绍了Ubuntu 12.10 – Ruby gem rmagick缺少依赖性问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
像许多其他人一样,我在运行bundle install时在Ubuntu上安装rmagick时遇到了麻烦.

我在bundle install命令上遇到这个错误

  1. Installing rmagick (2.13.1)
  2. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  3.  
  4. /usr/local/rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
  5. checking for Ruby version >= 1.8.5... yes
  6. checking for gcc... yes
  7. checking for Magick-config... no
  8. 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
  9.  
  10. *** extconf.rb Failed ***
  11. Could not create Makefile due to some reason,probably lack of
  12. necessary libraries and/or headers. Check the mkmf.log file for more
  13. details. You may need configuration options.
  14.  
  15. Provided configuration options:
  16. --with-opt-dir
  17. --without-opt-dir
  18. --with-opt-include
  19. --without-opt-include=${opt-dir}/include
  20. --with-opt-lib
  21. --without-opt-lib=${opt-dir}/lib
  22. --with-make-prog
  23. --without-make-prog
  24. --srcdir=.
  25. --curdir
  26. --ruby=/usr/local/rvm/rubies/ruby-1.8.7-p371/bin/ruby
  27.  
  28.  
  29. Gem files will remain installed in /home/selfsale/.bundler/tmp/2908/gems/rmagick-2.13.1 for inspection.
  30. Results logged to /home/selfsale/.bundler/tmp/2908/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
  31.  
  32. An error occurred while installing rmagick (2.13.1),and Bundler cannot continue.
  33. Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.

然后我做了一些搜索,并找到了一些添加缺少的库的建议:

sudo apt-get install libmagick9-dev:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Package libmagick9-dev is not available,but is referred to by another package.
  5. This may mean that the package is missing,has been obsoleted,or
  6. is only available from another source
  7. However the following packages replace it:
  8. graphicsmagick-libmagick-dev-compat
  9.  
  10. E: Package 'libmagick9-dev' has no installation candidate

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

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Some packages could not be installed. This may mean that you have
  5. requested an impossible situation or if you are using the unstable
  6. distribution that some required packages have not yet been created
  7. or been moved out of Incoming.
  8. The following information may help to resolve the situation:
  9.  
  10. The following packages have unmet dependencies:
  11. graphicsmagick-libmagick-dev-compat : Depends: libgraphicsmagick1-dev but it is not going to be installed
  12. Depends: libgraphicsmagick++1-dev but it is not going to be installed
  13. E: Unable to correct problems,you have held broken packages.

sudo apt-get install libmagickwand-dev:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Some packages could not be installed. This may mean that you have
  5. requested an impossible situation or if you are using the unstable
  6. distribution that some required packages have not yet been created
  7. or been moved out of Incoming.
  8. The following information may help to resolve the situation:
  9.  
  10. The following packages have unmet dependencies:
  11. libmagickwand-dev : Depends: libmagickcore-dev (= 8:6.6.9.7-5ubuntu3.2) but it is not going to be installed
  12. E: Unable to correct problems,you have held broken packages.

sudo apt-get install libmagickcore-dev:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Some packages could not be installed. This may mean that you have
  5. requested an impossible situation or if you are using the unstable
  6. distribution that some required packages have not yet been created
  7. or been moved out of Incoming.
  8. The following information may help to resolve the situation:
  9.  
  10. The following packages have unmet dependencies:
  11. libmagickcore-dev : Depends: libbz2-dev but it is not going to be installed
  12. Depends: libfreetype6-dev but it is not going to be installed
  13. Depends: libpng-dev
  14. Depends: librsvg2-dev but it is not going to be installed
  15. Depends: libwmf-dev but it is not going to be installed
  16. Depends: libx11-dev but it is not going to be installed
  17. Depends: libxext-dev but it is not going to be installed
  18. Depends: libxt-dev but it is not going to be installed
  19. E: Unable to correct problems,you have held broken packages.

sudo apt-get install libmagick -dev:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Some packages could not be installed. This may mean that you have
  5. requested an impossible situation or if you are using the unstable
  6. distribution that some required packages have not yet been created
  7. or been moved out of Incoming.
  8. The following information may help to resolve the situation:
  9.  
  10. The following packages have unmet dependencies:
  11. libmagick++-dev : Depends: libmagickcore-dev (= 8:6.6.9.7-5ubuntu3.2) but it is not going to be installed
  12. Depends: libmagickwand-dev (= 8:6.6.9.7-5ubuntu3.2) but it is not going to be installed
  13. E: Unable to correct problems,you have held broken packages.

似乎任何安装正确软件包的尝试都会出现这个问题.

我刚刚看到一篇关于从源代码安装imagemagick的帖子,所以我打算尝试一下,但如果有人有任何更好的想法,我很乐意听到它们.

谢谢

我找到了解决方案:
  1. sudo apt-get install aptitude

然后火:

  1. sudo aptitude install graphicsmagick-libmagick-dev-compat

有人问:

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

答案:“n”

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

在第二个问题:

  1. The following actions will resolve these dependencies:
  2.  
  3. Downgrade the following packages:
  4. 1) libexif12 [0.6.20-2ubuntu0.1 (now) -> 0.6.20-2 (precise)]

答案:“Y”或按ENTER键

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

等到任务结束;)

猜你在找的Ubuntu相关文章