miniMagick 在 rails_admin 应用程序中识别错误:无法使用 MiniMagick 进行操作,也许它不是图像?

miniMagick identify error in rails_admin app: Failed to manipulate with MiniMagick, maybe it is not an image?

我正在使用 carrierwavemini_magick gem 来使用 rails_admin 中的图像。当我上传图片时失败并出现此错误:

Failed to manipulate with MiniMagick, maybe it is not an image? 
Original Error: `identify C:/Users/Zeke/AppData/Local/Temp/mini_magick20161027-21132-xdongz.png` failed with error: 
    identify.exe: RegistryKeyLookupFailed `CoderModulesPath' @ error/module.c/GetMagickModulePath/662. 
    identify.exe: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/501.

如果我不在我的 uploader.rb

中包含以下行,则不会发生这种情况
  # Process files as they are uploaded:
  process resize_to_fit: [800, 600]

  # Create different versions of your uploaded files:
  version :thumb do
    process resize_to_fill: [40, 30]
  end

我需要缩略图,我该怎么做?


Here's What I'm sure of:

我做错了什么?

我测试的 identifyconvert 都工作正常,除了 它们 实际上没有被 rails 使用,这使用了另一个非常旧的 imagemagick 安装并首先抛出了这个 translation missing 错误,我设法通过在 en.yml

中添加几行来解决

It is notable that System Environment Variables can be overridden by set path that only lasts long for that instance of cmd

让 rails 使用新版本的 ImageMagick 解决了这个问题。 学分:马克·塞切尔