rmagick gem install “找不到 Magick-config" [英] rmagick gem install "Can't find Magick-config"

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

问题描述

我在尝试安装 rmagick gem 时收到如下所示的错误.我在 Snowleopard 10.6 上使用 RVM、Ruby 1.9.2-head 和 Rails 3.05.对类似问题的回答建议安装 ImageMagick,我成功地做到了.其他人建议安装libmagick9-dev 库",但是,我不知道如何执行此操作.

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

更新如果您是 Mac/OS X 用户,我强烈建议您使用 Homebrew 作为您的软件包安装程序/管理器.您可以在此处找到它.自从最初问这个问题以来,我已经删除了我之前安装的所有 rmagick 和 imagemagick 之类的东西,并使用 Homebrew 重新安装了它们.拥有大量软件包目录,超级简单,更新/卸载也轻而易举!

UPDATE If 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!

推荐答案

在构建原生 Ruby gem 时,有时您会收到包含ruby extconf.rb"的错误.这通常是由于缺少您正在安装的 gem 甚至 Ruby 本身的开发库造成的.

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.

您的机器上是否安装了 apt?如果没有,我建议安装它,因为这是获取大量开发库的一种快速简便的方法.

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.

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

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

或在 centOs 上:

or on centOs:

$ yum install ImageMagick-devel

在 Mac OS 上,您可以使用 Homebrew:

On Mac OS, you can use Homebrew:

$ brew install imagemagick

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆