title: Unable to connect spree app with s3
body: <p>I have gone through many documentations but still lying on the same issue, I am trying to upload my product images on s3 locally and on heroku as well,
  but not able to do so. On localhost image is getting uploaded but not reflecting on s3 bucket console and on heroku Iam encountering a error page
  Please Help</p>
  
  <p><em>config/initializers/spree.rb</em></p>
  
  <pre><code>Spree.config do |config|
     # Example:
     # Uncomment to override the default site name.
    #  config.site_name = "Gazella Running Costumes"
    #  config.logo = "store/rungazella.png"
  
    #S3 configuration
    if Rails.env.production? then
         #production. Store images on S3.
         # development will default to local storage
        attachment_config = {
        s3_credentials: {
          access_key_id: "xxx",
          secret_access_key: "xxxxx",
          bucket: "xx",
        },
  
  
        storage:        :s3,
        s3_headers:     { "Cache-Control" =&gt; "max-age=31557600" },
        s3_protocol:    "https",
        bucket:         "xx",
  
        path:          ":rails_root/public/:class/:attachment/:id/:style/:basename.:extension",
        default_url:   "/:class/:attachment/:id/:style/:basename.:extension",
        default_style: "product",
        }
  
        attachment_config.each do |key, value|
             Spree::Image.attachment_definitions[:attachment][key.to_sym] = value
        end
    end
  Spree.user_class = "Spree::User"
  end  
  </code></pre>
  
  <p><em>Gemfile</em></p>
  
  <pre><code>source 'https://rubygems.org'
  
  ruby '2.2.2'
  gem 'rails', '4.2.4'
  group :development do
      gem 'sqlite3'
  end 
  group :production do
      gem 'pg'
      gem 'rails_12factor'
  end
  gem 'aws-sdk', '&lt; 2.0'     
  gem 'sass-rails', '~&gt; 5.0'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'coffee-rails', '~&gt; 4.1.0'
  gem 'jquery-rails'
  gem 'turbolinks'
  gem 'jbuilder', '~&gt; 2.0'
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  
  group :development, :test do
    gem 'byebug'
  end
  
  group :development do
    gem 'web-console', '~&gt; 2.0'
    gem 'spring'
  end
  gem 'spree', '3.0.4'
  gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
  gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
  </code></pre>
  
  <p>I have also tried commenting out </p>
  
  <pre><code>path:          ":rails_root/public/:class/:attachment/:id/:style/:basename.:extension"
  </code></pre>
  
  <p>in <strong>spree.rb</strong> file as per a previous post on stackoverflow but this even did not helped</p>