我正試圖重新創建所有的拇指。我不知道爲什麼說這個關鍵不存在。我已經AWS-S3配置正確,它的工作好(我可以上傳圖片,沒有任何問題。)重新生成拇指時的回形針問題
>> Attachment.all.each {|x|x.attachment.reprocess!}
AWS::S3::NoSuchKey: The specified key does not exist.
/app/d999782b-a789-4763-ac86-e8c65fa781eb/home/.bundle/gems/ruby/1.8/gems/aws-s3- 0.6.2/lib/aws/s3/error.rb:38:in `raise'
/app/d999782b-a789-4763-ac86-e8c65fa781eb/home/.bundle/gems/ruby/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:72:in `request'
/app/d999782b-a789-4763-ac86-e8c65fa781eb/home/.bundle/gems/ruby/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `get'
/app/d999782b-a789-4763-ac86-e8c65fa781eb/home/.bundle/gems/ruby/1.8/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:134:in `value'
當我試圖做同樣的單個對象似乎做得很好,所以這個問題似乎與生成一個集合有關。
>> Attachment.last.attachment.reprocess!
=> true
更新:我敢肯定它的相關的事實,有上傳的文件,如熱媒,應該是有效的圖像文件。任何想法如何跳過他們?
嘗試添加一些日誌信息,Attachment.all.each {| X | Rails.logger.error「我正在處理#{x.id}」; x.attachment.reprocess!}或簡單的使用放入控制檯。也許是缺少資產。 – andrea 2011-03-08 11:38:54
我有完全相同的問題,一直沒能弄清楚... – Andrew 2011-06-15 22:42:22
馬丁 - 哈拉爾的答案爲我解決了它,你應該試試看,如果它對你有用,就給他答案。 – Andrew 2011-06-22 02:28:36