简体   繁体   中英

Imagemagick Paperclip Error With Uploading JPG Image

I recently changed my server to Ubuntu 18.04 and now I have an error with paperclip and imagemagick. File uploads work locally but not on my server. I am running rails 5.2.3 and paperclip 5.2.1 and ImageMagick 7.0.8-56. I added the following line to environments/production.rb:

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

but still get the error. When I run identify -list format to see what files Imagemagick works with, it does not say jpg, which is different than my old server. Here is the partial output:

     ICON* rw-   Microsoft icon
      IIQ  r--   Phase One Raw Image Format
     INFO  -w+   The image format and characteristics
   INLINE* rw+   Base64-encoded inline images
      IPL* rw+   IPL Image Sequence
   ISOBRL* -w-   ISO/TR 11548-1 format
  ISOBRL6* -w-   ISO/TR 11548-1 format 6dot
      JNX* r--   Garmin tile format
     JSON  -w+   The image format and characteristics
        K* rw+   Raw black samples
      K25  r--   Kodak Digital Camera Raw Image Format
      KDC  r--   Kodak Digital Camera Raw Image Format
    LABEL* r--   Image label

The error I get is Paperclip::Errors::NotIdentifiedByImageMagickError in my production log when I upload an image.

Some files were apparently not installed because I installed imagemagick from source. I had to hard delete the folder with imagemagick in it and reinstall using sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev . Thank you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM