3

我正在使用带有 ActiveAdmin 的 Paperclip 在文章中上传图片。

但是我有一个问题,当我在编辑现有的文章时,Webrcik 启动后的第一次,它的功能非常好。但系统地,我第二次尝试编辑一篇文章(无论是哪一篇)Windows 告诉我“file.exe”停止运行,并且浏览器中出现“Internal Server Error Invalid argument - STDOUT”。

所以,我重新启动 webrick,并且只上传一次等......

这是日志:

Started PUT "/admin/articles/1" for 127.0.0.1 at 2012-10-24 18:11:45 +0200
Processing by Admin::ArticlesController#update as HTML

  Parameters: {"utf8"=>"✓", "authenticity_token"=>"VaB3lx3UZaOjUA6Yh+h8jG7ZExSQZDiyZUw6GYJQPbY=", "article"=>{"title"=>"ee", "desc"=>"ee", "content"=>"eeee", "photo"=>#<ActionDispatch::Http::UploadedFile:0x3cce7f0 @original_filename="Desert.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"article[photo]\"; filename=\"Desert.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:C:/Users/Greg/AppData/Local/Temp/RackMultipart20121024-6620-oorxwu>>}, "commit"=>"Update Article", "id"=>"1"}
  [1m[35mAdminUser Load (0.0ms)[0m  SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 2 LIMIT 1
  [1m[36mArticle Load (1.0ms)[0m  [1mSELECT `articles`.* FROM `articles` WHERE `articles`.`id` = ? LIMIT 1[0m  [["id", "1"]]

Command :: identify -format %wx%h "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]"

Command :: identify -format %m "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]"

Command :: identify -format %m "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]"

Command :: convert "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]" -auto-orient -resize "510x" -crop "510x350+0+16" +repage "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl20121024-6620-mvfl3a"

Command :: file -b --mime "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl20121024-6620-mvfl3a"

[paperclip] Error while determining content type: Command 'file -b --mime :file' returned 255. Expected 0
Command :: identify -format %wx%h "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]"

Command :: identify -format %m "C:/Users/Greg/AppData/Local/Temp/Desert20121024-6620-16n1ehl.jpg[0]"

Completed 500 Internal Server Error in 22073ms

Errno::EINVAL (Invalid argument - ruby_setenv):

我一直在寻找解决方案……但我没有找到。

有人知道问题的根源吗?

4

1 回答 1

0

The 'file' program isn't a part of Windows, which suggests you installed it (or something that includes it) to get this far - any idea what that was? Gnu provides a Windows version of 'file' as part of GnuWin32.

Learning more about your copy of that program will probably be the first step to fixing your problem. (Hope this helps.)

于 2013-09-09T03:34:53.943 回答