我的模型上有以下代码:

has_attached_file :photo, :styles => { :small => "150x150#" }, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/photo/:id/:style/:filename", :s3_headers => { 'Cache-Control' => 'max-age=315576000', 'Expires' => 10.years.from_now.httpdate }

上传图像时,仅保存原始图像,样式就无法正常工作。没有生成小的文件。

有帮助吗?

解决方案

您只需要将宝石更新为最新,最伟大的

其他提示

假设您的S3凭据还可以,也许您应该尝试为小文件设置文件类型。类似:styles => {:small =>“ 150x150#”,:png}

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top