本文介绍了rmagick gem install“无法找到Magick-config”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图安装rmagick gem时出现下面的错误。我在使用RVM,Ruby 1.9.2-head和Rails 3.05的Snowleopard 10.6上。对类似问题的回应建议安装ImageMagick,我已成功完成该操作。其他人建议安装libmagick9-dev库,但是,我无法弄清楚如何做到这一点。



我是一名新开发人员,任何帮助或指示对现有的解释或资源非常感谢。

  jjdevenuta(opal)$ gem install rmagick 
获取:rmagick-2.13.1.gem(100% )
构建原生扩展。这可能需要一段时间...
错误:安装rmagick时出错:
错误:无法构建gem本机扩展。

/Users/jjdevenuta/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
检查Ruby版本> = 1.8.5 ...是
检查gcc ...是
检查Magick-config ...否
无法安装RMagick 2.13.1。无法在/Users/jjdevenuta/.rvm/gems/ruby-1.9.2-head@rails3/bin:/Users/jjdevenuta/.rvm/gems/ruby-1.9.2-head@global/找到Magick-config斌:/Users/jjdevenuta/.rvm/rubies/ruby-1.9.2-head/bin:/Users/jjdevenuta/.rvm/bin:在/ usr / local / bin目录:在/ usr / local / sbin中:在/ usr /本地/ mysql / bin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / git / bin:/ usr / X11 / bin
$ b $ extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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 = / Users / jjdevenuta / .rvm / rubies / ruby​​-1.9.2-head / bin / ruby​​

更新
如果您是Mac / OS X用户,我强烈建议使用Homebrew作为您的软件包安装程序/管理器。你可以在找到它。自从最初提出这个问题以来,我已经删除了像rmagick和imagemagick之类的所有事先安装,并使用Homebrew重新安装了它们。超级简单,包含一个庞大的软件包目录,更新/卸载也很简单!

解决方案

有时你会得到一个包含ruby extconf.rb的错误。这通常是由于缺少你正在安装的Gem的开发库,甚至是Ruby本身造成的。



你有 apt 安装在你的机器上?如果没有,我建议安装它,因为这是一个快速而简单的方法来获得大量的开发库。



如果您看到有人建议安装libmagick9-dev ,那是你安装的一个apt包:

b

或centOs:

  $ yum install ImageMagick-devel 

在Mac OS上,您可以使用:

  $ brew install imagemagick 


I get the error shown below when attempting to install the rmagick gem. I am on Snowleopard 10.6 using RVM, Ruby 1.9.2-head and Rails 3.05. Responses to similar questions recommended installing ImageMagick, which I successfully did. Other suggested installing the "libmagick9-dev library", however, I can not figure out how to do this.

I'm a new developer, and any assistance or directions to an existing explanation or resource is greatly appreciated. Thanks!

jjdevenuta(opal)$ gem install rmagick
Fetching: rmagick-2.13.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/Users/jjdevenuta/.rvm/rubies/ruby-1.9.2-head/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 /Users/jjdevenuta/.rvm/gems/ruby-1.9.2-head@rails3/bin:/Users/jjdevenuta/.rvm/gems/ruby-1.9.2-head@global/bin:/Users/jjdevenuta/.rvm/rubies/ruby-1.9.2-head/bin:/Users/jjdevenuta/.rvm/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/X11/bin

*** 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=/Users/jjdevenuta/.rvm/rubies/ruby-1.9.2-head/bin/ruby

UPDATEIf you're a Mac/OS X user I would HIGHLY recommend using Homebrew as your package installer/manager. You can find it HERE. Since originally asking this question I have removed all my prior installs of things like rmagick and imagemagick, and reinstalled them using Homebrew. Super easy with a huge catalog of packages, and updates/uninstalls are a cinch as well!

解决方案

When building native Ruby gems, sometimes you'll get an error containing "ruby extconf.rb". This is often caused by missing development libraries for the gem you're installing, or even Ruby itself.

Do you have apt installed on your machine? If not, I'd recommend installing it, because it's a quick and easy way to get a lot of development libraries.

If you see people suggest installing "libmagick9-dev", that's an apt package that you'd install with:

$ sudo apt-get install libmagickwand-dev imagemagick

or on centOs:

$ yum install ImageMagick-devel

On Mac OS, you can use Homebrew:

$ brew install imagemagick

这篇关于rmagick gem install“无法找到Magick-config”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 04:25