【发布时间】:2012-05-06 11:13:09
【问题描述】:
我正在使用 Paperclip 和 AWS,并且可以成功地在我的本地主机上进行上传。我遇到的问题是当我将应用程序上传到 Heroku 时,我得到:
AWS::S3::Errors::SignatureDoesNotMatch (The request signature we calculated does not match the signature you provided. Ch
检查您的密钥和签名方法。)
Locations.rb
has_attached_file :photo,
:styles => { :thumb => "150x150#", :medium => "200x200#", :small => "50x50"},
:path => ":attachment/:id/:style.:extension",
:s3_domain_url => "adsimgstore.s3.amazonaws.com",
:storage => :s3,
:s3_credentials => S3_CREDENTIALS,
:bucket => 'adsimgstore',
:s3_permissions => :public_read,
:convert_options => { :all => "-auto-orient" }
s3 初始化
# initializers/s3.rb
if Rails.env == "production"
# set credentials from ENV hash
S3_CREDENTIALS = { :access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET'], :bucket => "adsimgstore"}
else
# get credentials from YML file
S3_CREDENTIALS = Rails.root.join("config/s3.yml")
end
我已经按照 Heroku 教程 https://devcenter.heroku.com/articles/s3 添加了所有键
有什么建议吗?
AWS::S3::Errors::SignatureDoesNotMatch (The request signature we calculated does not match the signature you provided. Ch
eck your key and signing method.):
2012-05-01T18:01:02+00:00 app[web.1]:
2012-05-01T18:01:02+00:00 app[web.1]: app/controllers/locations_controller.rb:76:in `block in update'
2012-05-01T18:01:02+00:00 app[web.1]: app/controllers/locations_controller.rb:75:in `update'
2012-05-01T18:01:02+00:00 app[web.1]:
【问题讨论】:
标签: ruby-on-rails-3 heroku paperclip