新Rails安装上的Paperclip欺骗错误

时间:2017-07-04 23:50:39

标签: ruby-on-rails imagemagick paperclip

我在新计算机上设置了Rails,并从github分叉了我的存储库。这个存储库在我的桌面计算机上运行得非常好。

但是现在为我的用户模型上传个人资料图片时出现此错误

Command :: file -b --mime "C:/Users/Maxence/AppData/Local/Temp/8ab130f329c41e18078e316bdd9fc5ae20170705-7476-1788hla.jpg"
[paperclip] Content Type Spoof: Filename 24112014-DSC00522.jpg (image/jpeg from Headers, ["image/jpeg"] from Extension), content type discovered from file command: . See documentation to allow this combination.
   (0.0ms)  BEGIN
Command :: file -b --mime "C:/Users/Maxence/AppData/Local/Temp/8ab130f329c41e18078e316bdd9fc5ae20170705-7476-g6nde9.jpg"
[paperclip] Content Type Spoof: Filename 24112014-DSC00522.jpg (image/jpeg from Headers, ["image/jpeg"] from Extension), content type discovered from file command: . See documentation to allow this combination.
   (0.0ms)  ROLLBACK

我不确定问题来自哪里

  • 我确保我下载了32位devkit(匹配我的Ruby版本2.3.3 32位)
  • 我有这个环境路径:C:\ DevKit32bits \ mingw \ bin
  • 我还有系统路径:C:\ Program Files \ ImageMagick-7.0.6-Q16和C:\ Program Files(x86)\ GnuWin32
  • 我将Rails gem与台式电脑相匹配(我在旧台式电脑上安装了Rails 5.1.2和5.1.1)

唯一的事情是,当我在新安装上运行which convert时,我从命令中得到C:\Windows\system32\convert.EXE作为答案,而我在台式计算机上出现错误,而且Paperclip工作正常......

添加Paperclip.options[:command_path] = 'C:\Windows\system32\'会产生新错误

0 个答案:

没有答案