简体   繁体   中英

Paperclip on Windows: [paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError>

I'm getting this error in development when I try to upload a file.

Command :: file -b --mime "C:/Users/Chloe/AppData/Local/Temp/dfeacdebdd52607b78a0eca093c2ed7a20170510-45680-1dipvsw.jpg"
Command :: identify -format '%wx%h,%[exif:orientation]' "C:/Users/Chloe/AppData/Local/Temp/dfeacdebdd52607b78a0eca093c2ed7a20170510-45680-ns50at.jpg[0]" 2>NUL
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>

I don't have identify command and it's not installed with ImageMagick (at least not anymore).

>dir "C:\Program Files\ImageMagick-7.0.5-Q16"\*.exe
 Directory of C:\Program Files\ImageMagick-7.0.5-Q16

04/25/2017  06:26 AM           324,096 dcraw.exe
04/25/2017  06:24 AM        33,351,680 ffmpeg.exe
04/25/2017  06:24 AM           113,664 hp2xx.exe
04/25/2017  06:30 AM           201,728 imdisplay.exe
04/25/2017  06:30 AM           112,128 magick.exe
05/10/2017  08:53 PM         1,202,385 unins000.exe
               6 File(s)     35,305,681 bytes

I installed ImageMagick from chocolatey . This question is similar, but out of date with no relevant answers.

Version: ImageMagick-7.0.5-Q16, paperclip (5.1.0)

You have to install

https://chocolatey.org/packages/imagemagick.tool

Instead. But you also have to adjust your path so ImageMagick's convert is before Window's convert

>where convert
C:\Windows\System32\convert.exe
C:\ProgramData\chocolatey\bin\convert.exe

Oh, and use refreshenv and restart your server.

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