Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 回形针图像重新处理,图像损坏和丢失_Ruby On Rails_Amazon S3_Paperclip - Fatal编程技术网

Ruby on rails 回形针图像重新处理,图像损坏和丢失

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

我缺少生产数据

我根据上传图片以优化网站的模式更改了图片的样式。我用回形针和s3来储存。这是我使用的代码

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,以查看到底发生了什么:

我该怎么做才能找回这些图像