我正在使用Paperclip和ActiveAdmin上传文章中的图片。
但我有一个问题,当我正在编辑现有文章时,Webrcik首次启动后,它的功能非常好。但系统地说,我第二次尝试编辑一篇文章(无论是哪一篇)Windows告诉我“file.exe”停止运行,并且浏览器中出现“内部服务器错误无效参数 - 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):
我一直在寻找解决方案......但我找不到。
有人知道问题的根源吗?
答案 0 :(得分:0)
&#39;&#39;程序不是Windows的一部分,它建议你安装它(或包含它的东西)来实现这一点 - 任何想法是什么? Gnu provides a Windows version of 'file' as part of GnuWin32。
了解有关该程序副本的更多信息可能是解决问题的第一步。 (希望这会有所帮助。)