Paperclip Error: NotIdentifiedByImageMagickError

醉酒当歌 提交于 2019-11-30 18:13:06

Most likely this is caused by the API change in Cocaine 4 which Paperclip has not caught up to yet. Try using the earlier version of Cocaine by inserting this line into your Gemfile:

gem "cocaine", "= 0.3.2" 

add gem "cocaine", "= 0.3.2"

then bundle install message

Bundler could not find compatible versions for gem "cocaine":   In Gemfile:
    paperclip (~> 3.0) x86-mingw32 depends on
      cocaine (~> 0.4.0) x86-mingw32

    cocaine (0.3.2)

it used to work fine for pdf and images, tried out for an hour or so, followed everything I googled later the problem was found in my model has_attached_file :attachment,

:styles => {:original=> "125x125#"}

had to comment this line, and it worked for other attachments like docx or odt etc..

After all your changes, don't forget to restart your server...!

For those who have a similar problem, be sure to double check that ImageMagick is installed, or make sure you do not use the 'styles' option.

I had this issue when using OSX + MAMP + Passenger + Paperclip and after setting the command_path and ensuring imagemagick was properly installed via brew, properly setting the temp and upload directories for passenger to something writable, it still wouldn't work!

The solution was to edit the envvars file for MAMP in /Applications/MAMP/Library/bin/envvars and comment out the export DYLD_LIBRARY_PATH line.

That is, change the line that says

export DYLD_LIBRARY_PATH

to

# export DYLD_LIBRARY_PATH

Then restart MAMP and feel the elation when your images are properly uploading/resizing.

I ran into this after upgrading to Mavericks. I ended up solving the problem by unlinking jpeg and re-linking it

brew unlink jpeg
brew link jpeg

And everything worked fine. BTW, running Paperclip 4.1

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