使用Homebrew安装的Lion上的Imagemagick问题 [英] Imagemagick issue on Lion installed with Homebrew

查看:167
本文介绍了使用Homebrew安装的Lion上的Imagemagick问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Rails项目中使用Paperclip gem,所以按照文档并首先使用Homebrew配方安装Imagemagick。

I am trying to use the Paperclip gem on a Rails project so followed the docs and first installed Imagemagick using the Homebrew recipe.

我在模型中添加了我的附件

I added to my model my attachment

has_attached_file :screenshot

这个工作正常,文件上传按预期运行

This worked OK and the file uploads functioned as expected

然后我想为此添加缩略图,所以再次按照文档添加到模型中

I then wanted to add thumbnails to this, so again followed the docs and added to the model

  has_attached_file :screenshot, 
                :styles => { :medium => "300x300>",
                             :thumb => "100x100>" }

此时上传不再有效

我检查了开发日志并发现了这一点:

I check the development logs and noticed this:

[32mCommand[0m :: identify -format %wx%h '/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png[0]'
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError:     
/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png is not recognized by the 'identify' command.>

在谷歌搜索后的某个时刻,我认为将默认路径设置为环境可能会出现问题变量

At which point after some googling I thought it might be a problem with setting the default path as an environment variable

Paperclip.options[:command_path] = "/usr/local/bin/"

但我检查这是正确的

which identify

它返回此路径

/usr/local/bin/identify

正如预期的那样

然后我尝试从命令行运行识别作为测试并得到此错误

I then tried to run identify from the command line as a test and got this error

dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
  Referenced from: /usr/local/bin/identify
  Reason: Incompatible library version: identify requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
Trace/BPT trap: 5

所以我认为我的问题不在于回形针,而在于imagebagick通过自制软件停止

So I think my problem is not with paperclip, but rather the install of imageMagick via homebrew

我已经尝试了所有建议包括

I've tried everything suggested including

brew update
brew remove imagemagick
brew install imagemagick

但它没有'帮助我运行Lion 10.7.2并安装了开发人员工具。

But it hasn't helped i'm running Lion 10.7.2 and have installed the developer tools.

任何建议都会非常感激。

Any suggestions would be very much appreciated.

推荐答案

我遇到了同样的问题。在操作系统上运行软件更新为我解决了这个问题。 libfree的版本已过时。 Paperclip,ImageMagick和Homebrew都运转良好。

I ran into the same issue. Running a software update on the operating system resolved it for me. The version of libfree is out of date. Paperclip, ImageMagick and Homebrew were all working fine.

这篇关于使用Homebrew安装的Lion上的Imagemagick问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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