安装 RMagick gem

编程入门 行业动态 更新时间:2024-10-28 18:24:20
本文介绍了安装 RMagick gem -- 找不到 MagickWand.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在 OSX 10.6.8 上安装 rmagick gem,使用 gem install rmagick,但出现以下错误

I am installing the rmagick gem on OSX 10.6.8, using gem install rmagick, and I am getting the following error

Can't install RMagick 2.13.1. Can't find MagickWand.h. *** 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 --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/disaacs/.rvm/rubies/ruby-1.9.3-p125/bin/ruby Gem files will remain installed in /Users/disaacs/.rvm/gems/ruby-1.9.3-p125/gems/rmagick-2.13.1 for inspection. Results logged to /Users/disaacs/.rvm/gems/ruby-1.9.3-p125/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

查看我看到的 mkmf.log 文件

Looking in the mkmf.log file I see

have_header: checking for wand/MagickWand.h... -------------------- no "/usr/bin/gcc-4.2 -E -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward -I/Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1 -I. conftest.c -o conftest.i" conftest.c:3:29: error: wand/MagickWand.h: No such file or directory

这是真的.在 gcc-4.2 命令的 -I 指令指定的任何目录中都找不到文件 MagickWand.h.为什么不呢?我该如何解决这个问题?

It's true. The file MagickWand.h is not found in any of the directories specific by the -I directives of the gcc-4.2 command. Why not? And how can I fix this?

ImageMagick 已安装,使用自制软件.如果我搜索我的驱动器,我会发现 MagicWand.h 安装在 /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/wand/MagickWand.h.

ImageMagick is installed, using homebrew. If I search my drive I find MagicWand.h installed in /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/wand/MagickWand.h.

我已经尝试了 中的所有建议不安装 RMagick 2.13.1.找不到 MagickWand.h.,但都没有找到.

I've tried all the suggestions in Can't install RMagick 2.13.1. Can't find MagickWand.h., but none of them have worked.

编辑:另一件要注意的事情:我最初使用 MacPorts 安装了 ImagMagick 6.7.0-7,而 RMagick 安装得很好.除了它不适用于 CarrierWave gem.所以我卸载了 MacPorts 并卸载了 RMagick.然后使用 brew install -f imagemagick --disable-openmp 重新安装 ImageMagick,并尝试重新安装 rmagick gem(这让我遇到了当前的问题).我在每一步都重新启动了所有终端,以确保我的路径被刷新.

Edit: Another thing to note: I originally had ImagMagick 6.7.0-7 installed using MacPorts, and RMagick installed just fine. Except that it would not work with the CarrierWave gem. So I uninstalled MacPorts and uninstalled RMagick. Then reinstalled ImageMagick using brew install -f imagemagick --disable-openmp, and attempted to reinstall the rmagick gem (which brings me to my current problem). I restarted all terminals at each step, to ensure that my paths were refreshed.

推荐答案

原来答案在 无法安装 RMagick 2.13.1.毕竟找不到 MagickWand.h..我刚刚错误地遵循了建议.

Turns out the answer was in Can't install RMagick 2.13.1. Can't find MagickWand.h. after all. I had just followed the suggestion incorrectly.

C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick gem install rmagick

这样就成功安装了 rmagick gem.

This installed rmagick gem successfully.

不幸的是,rmagic 仍然不能与 CarrierWave 一起使用 :-(,但这完全是一个不同的问题.

Unfortunately, rmagic is still not working with CarrierWave :-(, but that is a different problem altogether.

更多推荐

安装 RMagick gem

本文发布于:2023-10-13 20:15:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1488970.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:RMagick   gem

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!