我正试图重新创建所有的拇指。我不知道为什么说这个关键不存在。我已经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