使用Rake失败的S3回形针附件

时间:2014-03-11 23:12:37

标签: ruby-on-rails rake paperclip

我收到错误:

The request signature we calculated does not match the signature you provided. Check your key and signing method.

在rake任务中保存附件时。相同的文件文件通过活动管理界面正确保存到同一模型。 Rake任务在从3开始升级到rails 4和paperclip 4之前有效。

我正在运行rails 4.0.2和ruby 2.1.1 gem“paperclip”,“〜> 4.1.0”

我的回形针配置如下所示:

 config.paperclip_defaults = {
:storage        => :s3,
:s3_credentials => {
  :bucket             => ENV['S3_BUCKET_NAME'],
  :access_key_id      => ENV['AWS_ACCESS_KEY_ID'],
  :secret_access_key  => ENV['AWS_SECRET_ACCESS_KEY'],
  #      :s3_protocol => "http",  do i need this?
  :s3_endpoint        => 's3-ap-southeast-2.amazonaws.com'

},
:s3_endpoint    =>  's3-ap-southeast-2.amazonaws.com',
:s3_host_name   => 's3-ap-southeast-2.amazonaws.com'

}

为什么rake任务不保存附件?

0 个答案:

没有答案