Rails 3 - RMagick doesn't find libfreetype.6.dylib using Paperclip

孤街醉人 提交于 2019-12-10 20:44:42

问题


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 is not recognized by the 'identify' command.

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

gem 'Rmagick'

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 `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

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'

from my GemFile.

Any ideas ?

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

Bye


回答1:


Locate your libfreetype.6.dylib eg:

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

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.

Otherwise an update will fix.



来源:https://stackoverflow.com/questions/13346697/rails-3-rmagick-doesnt-find-libfreetype-6-dylib-using-paperclip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!