title: Rails paperclip with s3 - Invalid argument
body: <p>I set up an app with use of Paperclip to cover user avatar's issue. I want to store files on amazon s3. I cannot find a solution for this problem so finally I decided to ask here:</p>
  
  <p>Here is connection setup in user model:</p>
  
  <pre><code>has_attached_file :avatar, 
  :styles =&gt; { :small =&gt; "150x150#", :medium =&gt; "300x300#" },
  :storage =&gt; :s3,
  :s3_credentials =&gt; Rails.root.join('config/s3.yml')
  </code></pre>
  
  <p>Then here is s3.yml file:</p>
  
  <pre><code>bucket: sghub      
  access_key_id: ###
  secret_access_key: #####
  </code></pre>
  
  <p>Of course in my gemfile I have added:</p>
  
  <pre><code>gem 'paperclip'
  gem 'aws-s3', :require =&gt; 'aws/s3'
  </code></pre>
  
  <p>The app is deployed on Heroku so the error I get from <code>heroku logs</code> command is like this:</p>
  
  <pre><code>2012-02-20T07:13:58+00:00 app[web.1]: AWS::S3::PermanentRedirect (The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.)
  </code></pre>
  
  <p>Also in development mode the error page is like:</p>
  
  <pre><code>Errno::EINVAL in UsersController#update
  Invalid argument
  </code></pre>
  
  <p>Also it appears that files doesn't upload on s3, as they are not visible in management console in my bucket. I have pretty much no idea now as I tried to set up everything like in all tutorials and documentation. Any ideas?</p>