简体   繁体   English

使用MacPorts在Mac OS X上安装RMagick

[英]Installing RMagick on Mac OS X with MacPorts

With the MacPorts version of ImageMagick 6.4.4 installed, I'm getting an error installing the RMagick gem. 安装了MacPorts版本的ImageMagick 6.4.4后,我在安装RMagick gem时遇到错误。

/opt/local/bin/ruby extconf.rb update rmagick
checking for Ruby version >= 1.8.2... yes
checking for /usr/bin/gcc-4.0... yes
checking for Magick-config... no
Can't install RMagick 2.7.0. Can't find Magick-config in
    /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands:
    /Users/jason/.bin:/opt/local/bin:/usr/local/bin:/usr/local/mysql/bin:
    /usr/local/ec2-api-tools/bin:/opt/local/bin:/usr/bin:
    /usr/local/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

I've installed older versions of rmagick successfully. 我成功安装了旧版本的rmagick。 I've seen references to a dev package of ImageMagick, but it doesn't seem to be available from MacPorts. 我已经看到了对ImageMagick开发包的引用,但似乎MacPorts似乎没有。

How can I install RMagick 2.7 on Mac OS X with ImageMagick 6.4.4 from MacPorts? 如何使用MacPorts的ImageMagick 6.4.4在Mac OS X上安装RMagick 2.7?

I suggest using Homebrew instead of Macports. 我建议使用Homebrew而不是Macports。 After installing Homebrew, run: 安装Homebrew后,运行:

brew install imagemagick
gem install rmagick

Try this from the command line before installing the rmagick gem: 在安装rmagick gem之前从命令行尝试这个:

sudo port install tiff -macosx imagemagick +q8 +gs +wmf

Also have you read the installation documentation here ? 也有你阅读安装文档在这里

The install script can't find Magick-config in your path. 安装脚本在您的路径中找不到Magick-config。 Did you use a non-standard install location when you installed ImageMagick through MacPorts? 通过MacPorts安装ImageMagick时是否使用了非标准安装位置? Usually it goes into /opt/local/bin/ 通常它进入/ opt / local / bin /

You can see where MacPorts put your Magick-config by running: 您可以通过运行来查看MacPorts放置Magick-config的位置:

port contents ImageMagick 端口内容ImageMagick

If you find it listed there, then make sure that the directory is included in your PATH and rerun the rmagick install. 如果您在其中找到它,请确保该目录包含在PATH中并重新运行rmagick安装。

I've run the install command, but I keep getting this error: 我运行了install命令,但是我一直收到这个错误:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- RMagick2.so (LoadError) /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`gem_original_require':没有要加载的文件 - RMagick2.so(LoadError)

Turns out it correctly builds the shared object file, but the name is "wrong". 事实证明它正确地构建了共享对象文件,但名称是“错误的”。

The file I get is named /Library/Ruby/Gems/1.8/gems/rmagick-2.11.1/lib/RMagick2.bundle ; 我得到的文件名为/Library/Ruby/Gems/1.8/gems/rmagick-2.11.1/lib/RMagick2.bundle ; renaming it to RMagick2.so fixes this issue. 将其重命名为RMagick2.so解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM