Rails 3 - RMagick使用Paperclip找不到libfreetype.6.dylib [英] Rails 3 - RMagick doesn't find libfreetype.6.dylib using Paperclip

查看:135
本文介绍了Rails 3 - RMagick使用Paperclip找不到libfreetype.6.dylib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Paperclip上传一些图片。它工作正常,但如果我想添加一些样式:

I'm trying to use Paperclip to upload some image. It's work fine but if I want add some style with :

:styles => { :small => "100x100" }

它不再起作用了,我有这样的错误信息:

It does not work anymore, I have this error message :


myImage 未被'identify'命令识别。

myImage is not recognized by the 'identify' command.

所以,我在网上找到了一些提示,我已经用Brew安装了ImageMagick然后我添加了

So, I've found some tips on the web and I've installed ImageMagick with Brew then I've added

gem 'Rmagick'

到我的GemFile。

to my GemFile.

现在,当我重新启动服务器时,收到此消息错误:

And now when I restart my server, I get this message error :


/ usr / local / rvm /gems/ruby-1.9.3-p194@global/gems/rmagick-2.13.1/lib/rmagick.rb:11:in,requiree':dlopen(/usr/local/rvm/gems/ruby-1.9.3 -p194@global/gems/rmagick-2.13.1/lib/RMagick2.bundle,9):未加载库:/usr/X11/lib/libfreetype.6.dylib(LoadError)
引自:/ usr /local/lib/libMagickCore.5.dylib
原因:不兼容的库版本:libMagickCore.5.dylib需要版本14.0.0或更高版本,但libfreetype.6.dylib提供版本10.0.0 - /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rmagick-2.13.1/lib/RMagick2.bundle

/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require': dlopen(/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /usr/X11/lib/libfreetype.6.dylib (LoadError) Referenced from: /usr/local/lib/libMagickCore.5.dylib Reason: Incompatible library version: libMagickCore.5.dylib requires version 14.0.0 or later, but libfreetype.6.dylib provides version 10.0.0 - /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rmagick-2.13.1/lib/RMagick2.bundle

我已经更新了我的X11并安装了XQuartz,但没有任何事情可以继续使用。
我可以重新启动rails服务器如果我删除

I've updated my X11 and installed XQuartz, but nothing to do it's doesn't work anymore. I can restart rails server if I remove

gem 'Rmagick'

来自我的GemFile。

from my GemFile.

任何想法?

非常感谢,我已经花了10个小时来解决这个问题而没有弄明白!

Thank you very much, I've spent 10 hours on this bug without figure out it !!

再见

推荐答案

找到你的libfreetype.6.dylib例如:

Locate your libfreetype.6.dylib eg:

sudo find / -name "libfreetype.6.dylib" -print

确保你的版本是14.0 .0或更高版本(上面是我在macosx上的路径)例如:

Make sure that your version is 14.0.0 or later (the above is my path on macosx) eg:

otool -L /usr/X11/lib/libfreetype.6.dylib

如果版本正确,可能是库路径问题。

If the version is right, maybe you have a library path problem.

否则将更新更新。

这篇关于Rails 3 - RMagick使用Paperclip找不到libfreetype.6.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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