我已经看到很多关于这个错误的引用,但它们都与上传无关,所以我在这里看看其他人是否看到了这个。
我有一个应用程序在 Heroku 的cedar
堆栈上运行,一切正常,直到我必须上传一个带有 UTF-8 字符的文件,它只是失败并出现以下错误,我不知道发生了什么或为什么会这样,因为表单正文是UTF-8(因为 Rails 在所有形式上都强制使用它)。
我有另一个应用程序几乎做同样的事情,但它没有在 Heroku 上运行,它在接收带有 UTF-8 字符的上传文件时工作文件。任何人都知道这可能是什么或我该如何解决?
2012-07-31T17:43:59+00:00 app[web.1]: Started POST "/attachments" for 177.82.145.36 at 2012-07-31 17:43:59 +0000
2012-07-31T17:43:59+00:00 app[web.1]: Processing by AttachmentsController#create as HTML
2012-07-31T17:43:59+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"qhQ8bO/j6WFdu/AGLli6+KrXZPAsFfynwKBN6MqQt9Y=", "attachment"=>{"name"=>"JINGLE CUITÉ", "category_id"=>"8", "city_id"=>"8", "link"=>"", "assets_attributes"=>{"1"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x0000000504d7d8 @original_filename="Tárcio 40.mp3", @content_type="audio/mpeg", @headers="Content-Disposition: form-data; name=\"attachment[assets_attributes][1][file]\"; filename=\"T\xC3\xA1rcio 40.mp3\"\r\nContent-Type: audio/mpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20120731-2-1e58fuf>>}}, "description"=>""}, "commit"=>"Criar arquivo"}
2012-07-31T17:43:59+00:00 app[web.1]: [paperclip] Saving attachments.
2012-07-31T17:43:59+00:00 app[web.1]: [paperclip] saving attachments/2/original_Tárcio_40.mp3
2012-07-31T17:44:00+00:00 app[web.1]: Completed 500 Internal Server Error in 393ms
2012-07-31T17:44:00+00:00 app[web.1]:
2012-07-31T17:44:00+00:00 app[web.1]: app/controllers/crud_controller.rb:20:in `create'
2012-07-31T17:44:00+00:00 app[web.1]: Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):