我使用回形针将图像上传到 S3,
has_attached_file :attachment,
styles: { mini: '48x48>', small: '100x100>', product: '240x240>', large: '600x600>',larger: '860x1280>' },
default_style: :product
validates_attachment :attachment,
:presence => true,
:content_type => { :content_type => %w(image/jpeg image/jpg image/png image/gif) }
现在,我想使用 gem "paperclip-compression" 压缩已经上传到 S3 的图像,所以我添加了 processors: [:thumbnail, :compression],
How would I update all the attachments using a ruby script??。我能够读取图像并将其存储到文件中,但无法使用文件更新附件。