2013-03-11 117 views
5

我有一些回形針問題。當我有一個「#」跟隨尺寸(縮放和裁剪)時,我得到一個422錯誤。我的日誌這樣說:回形針422錯誤

Command :: convert '/tmp/**** (20130110)20130311-13571-xxasmt.png[0]' -auto-orient -resize "150x150#" '/tmp/**** (20130110)20130311-13571-xxasmt20130311-13571-1anrx0y' 
[paperclip] An error was received while processing: #<Paperclip::Error: There was an error processing the thumbnail for **** (20130110)20130311-13571-xxasmt> 
Completed 422 Unprocessable Entity in 2785ms (Views: 0.8ms | ActiveRecord: 9.1ms) 

這是在型號我回形針代碼:

has_attached_file :image, 
    :styles => { 
    :medium => "300x300#", 
    :thumb => "100x100>", 
    :standard => "150x150>" 
    }, 
    :storage => :s3, 
    :s3_credentials => "#{Rails.root}/config/s3.yml", 
    :bucket => "convertkit", 
    :s3_protocol => "https" 

我缺少的東西?

+0

檢查您的應用服務器的stderr日誌。 imagemagick的convert工具可能會有一些輸出,說明它爲什麼不能被處理。 – 2013-03-17 18:14:55

+0

stderr日誌在哪裏? – 2013-03-17 18:17:51

+0

這取決於您的網絡服務器和操作系統。例如,對於Redhat-ish操作系統上的Apache,它將是'/ var/log/httpd/error_log'。 – 2013-03-17 18:22:15

回答

0
has_attached_file :avatar, 
       :styles => { 
          :thumb => "60x60>", :medium => "120x120>", 
          :original => "100%", small2: "65x65>", medium2: "144x144>" 
          }, 
          :storage => :s3, 
          :s3_credentials => "#{::Rails.root.to_s}/config/aws.yml", 
          :s3_permissions => "public-read", 
          :url => ':s3_alias_url', 
          :path => "/slider/:attachment/:id_partition/:style/:filename", 
          :s3_host_alias => Settings.cloud_front_url, 
          :s3_protocol => :https, 
          :s3_headers => {'Expires' => (Time.now + 6060243012).httpdate}, 
          default_url: "paperclip_default/slider/:style_missing.png" 
+0

這對我很好用 – 120sturm 2015-12-11 10:13:26

+0

請編輯您的答案的格式! – jogo 2015-12-11 10:24:53