2012-04-20 106 views
2

Paperclip + S3在本地機器上工作,但不工作在Heroku上。它說「AWS :: S3 ::錯誤:: SignatureDoesNotMatch」Heroku回形針S3錯誤=> AWS :: S3 :: Errors :: SignatureDoesNotMatch

2012-04-20T21:24:37 + 00:00應用程式[web.1]:參數:{ 「UTF8」=> 「Γ」, 「authenticit y_token」=>「MHt20N64y9L24Ga2y6gGj8hX06U + td17XIRdqMadcCQ =」, 「post」=> {「title」=>「tes t」,「organisation_id」=>「1」,「content」=「 >「weeqw」, 「attachments_attributes」=> {「0」=> {「pic」=>#>}}}, 「commit」=>「創建帖子」} 2012-04-20T21:24:41 +00:00 app [web.1]: 已完成500次內部服務器錯誤344 6ms 2012-04-20T21:24:41 + 00:00 app [web.1]:2012-04-20T21:24:41 +00:00 應用[web.1]:AWS :: S3 :: Errors :: SignatureDoesNotMatch(請求 我們計算的簽名與您提供的簽名不匹配。車 CK密鑰和簽名方法):

這裏是我的attachment.rb型號:

has_attached_file :pic, :styles => { :medium => "500x280>",:slide => "180x260>", :thumb => "150x100#" },  
:storage => :s3, 
      :bucket => 'sample_bucket', 
      :s3_credentials => { 
       :access_key_id => 'ASDDSAMPLEKEYDFSDF', 
       :secret_access_key => 'Dfsdf887-sample-secret-key-dfdsasd', 
      } 

什麼可能是這個錯誤的原因是什麼?

回答

1

我有回形針2.4.5這裏是模型裏面的定義:

has_attached_file :logo, 
       :path => "assets/:class/:attachment/:id/:style.:extension", 
       :storage => :s3, 
       :bucket => ENV['S3_BUCKET'], 
       :s3_permissions => 'authenticated-read', 
       :s3_protocol => "http", 
       :s3_credentials => { :access_key_id => ENV['S3_KEY'], 
            :secret_access_key => ENV['S3_SECRET'] }, 
       :styles => { :index => "72x72>", 
          :billboard => "120x120>" } 
相關問題