Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create

后端 未结 3 1541
予麋鹿
予麋鹿 2020-12-06 21:49

I am attempting to setup Spree for the first time. Everything was going well until I hit the image upload. I have installed Imageamgick using homebrew on Mac OSX Mountain Li

相关标签:
3条回答
  • 2020-12-06 22:07

    Check if png format is in the list of compiled formats of identify:

    identify -list format
    

    If it's not, you might have to recompile it with these options:

    ./configure --prefix=/usr/local --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes
    
    0 讨论(0)
  • 2020-12-06 22:29

    My error was - “Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController

    I fixed this error some days ago.

    Before that I tried:

    • Update XCode (with Command-Line Tools)
    • Update Imagemagick (i tried it from source and as binary module)
    • Update MacPort
    • Used Brew (refreshing with all dependencies for Imagemagic, used “brew doctor”), not MacPort
    • Reinstall all gems that use Imagemagick
    • Bundle update
    • etc

    And sure I had my “Paperclip::Attachment.default_options[:command_path]” option in production.rb file pointing to Imagemagick bin folder.

    Several times i did it from a to z, again and again.

    But nothing could help me.

    By the way, in all cases i had worked fine “convert”, “identify” and “display” with test images of any kind, but not in my rails app (spree app).

    I dived dipper and tried to do research inside rails console with

    Paperclip.run("identify", "-format %m :file", :file => "/path/to/image”) 
    

    as paperclip do. And only new format (cocaine 0.4) of this command:

    Paperclip.run("identify", "-format %m /path/to/image")
    

    worked fine!!!

    As a result, i found that cocaine 0.4 is the source of my problem. I tried downgrade to cocaine 0.3.2 in my Gemfile and my Spree app start working!!!

    All i need to do is use cocaine 0.3.2 instead of 0.4!!!

    0 讨论(0)
  • 2020-12-06 22:29

    Also I met the problem when image file doesn't exists in public folder.
    I've just copied a random file with the same name and everything started work.

    parepclip 2.7.5 cocain 0.3.2
    
    0 讨论(0)
提交回复
热议问题