Ruby on rails 回形针图像重新处理,图像损坏和丢失
我缺少生产数据 我根据上传图片以优化网站的模式更改了图片的样式。我用回形针和s3来储存。这是我使用的代码Ruby on rails 回形针图像重新处理,图像损坏和丢失,ruby-on-rails,amazon-s3,paperclip,Ruby On Rails,Amazon S3,Paperclip,我缺少生产数据 我根据上传图片以优化网站的模式更改了图片的样式。我用回形针和s3来储存。这是我使用的代码 has_attached_file :attachment, styles: lambda {|attachment| { original: ( attachment.instance.source_type.eql?("Trip")? ["1200x800>", 'jpg'] : attachment.instance.source_type.eql?("Us
has_attached_file :attachment, styles: lambda {|attachment| {
original: (
attachment.instance.source_type.eql?("Trip")? ["1200x800>", 'jpg'] :
attachment.instance.source_type.eql?("User")? ["200x200>", 'jpg'] :
attachment.instance.source_type.eql?("Milestone")? ["700x500>", 'jpg'] :
attachment.instance.source_type.eql?("Moment")? ["700x500>", 'jpg'] :["10x10>", 'jpg']
),
medium: (
attachment.instance.source_type.eql?("Trip")? ["500x300>", 'jpg'] : ["10x10", 'jpg']
)
}
}
这是我用于重新处理的命令
Image.find_each { |image| image.attachment.reprocess!}
这在测试服务器上运行良好。所以,我在生产数据中使用了这个。现在,一些图片在制作过程中丢失,一些图片显示访问被拒绝。下面是您可以检查的两个图像URL,以查看到底发生了什么:
我该怎么做才能找回这些图像