title: SignatureDoesNotMatch using ruby aws-sdk gem and presigned pos
body: <p>I need some help to get the new ruby <a href="https://github.com/aws/aws-sdk-core-ruby" rel="nofollow">AWS S3 SDK 2.0</a> working. I am using the region <code>eu-central-1</code> so it is required to use the latest signature method <code>v4</code> for all requests.</p>
  
  <p>Actually I want to create a presigned post url to use it in combination with jquery-fileupload. I have setup S3 correctly with all access keys, bucket, CORS configuration, etc. But every time I generate a url with the following code</p>
  
  <pre><code>@signer = Aws::S3::Presigner.new
  @url = @signer.presigned_url(:put_object, bucket: ENV['S3_BUCKET_NAME'], key: "documents/#{SecureRandom.uuid}/${filename}", acl: :public_read)
  </code></pre>
  
  <p>which creates the following URL</p>
  
  <pre><code>https://project-xxxxx-staging.s3.eu-central-1.amazonaws.com/documents/a253feb0-4c60-4735-8d95-4649c0d3dcb5/%24%7Bfilename%7D?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAJVY57LY6XGIRIRHQ%2F20150205%2Feu-central-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20150205T140425Z&amp;X-Amz-Expires=900&amp;X-Amz-SignedHeaders=host&amp;x-amz-acl=public_read&amp;X-Amz-Signature=ff2fbe233ed7380dc745aa7ba37421d7d8703db0d67208541e500367262a8c51
  </code></pre>
  
  <p>I get the following error</p>
  
  <pre><code>&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;
  &lt;Message&gt;The request signature we calculated does not match the signature you provided. Check your key and signing method.&lt;/Message&gt;
  </code></pre>
  
  <p>Does anybody know how to fix this or any hints on the underlying problem?</p>
  
  <p>My environment I am using:</p>
  
  <pre><code>ruby '2.2.0' 
  gem 'rails', '4.2.0' 
  gem 'aws-sdk', '~&gt; 2.0.21.pre'
  </code></pre>