title: uploading files to amazon aws3 error Forbidden
body: <p>Yesterday it worked well. Now I have this error.
  I run my website locally.</p>
  
  <pre><code>Expected(200) &lt;=&gt; Actual(403 Forbidden) excon.error.response :body =&gt; "&lt;?xml version=\"1.0\"
   encoding=\"UTF-8\"?&gt;\n&lt;Error&gt;&lt;Code&gt;AccessDenied&lt;/Code&gt;&lt;Message&gt;Access
   Denied&lt;/Message&gt;&lt;RequestId&gt;C19FF4E3F2&lt;/RequestId&gt;&lt;HostId&gt;fUbWBNTH+qXOK0+QsFJzdARhvQ+KgRuwTZyklnq3v9WI/gt3I=&lt;/HostId&gt;&lt;/Error&gt;"
   :headers =&gt; { "Connection" =&gt; "close" "Content-Type" =&gt;
   "application/xml" "Date" =&gt; "Sat, 27 Feb 2016 08:06:19 GMT" "Server"
       =&gt; "AmazonS3" "x-amz-id-2" =&gt; "fUbWBNTH+nYXztwhtbwwWmsRzdARhvQ+KgRuwTZyklnt3I="
   "x-amz-request-id" =&gt; "C19FF4E4E9A863F2" } :local_address =&gt;
   "192.168.1.5" :local_port =&gt; 60867 :reason_phrase =&gt; "Forbidden"
   :remote_ip =&gt; "54.231.235.77" :status =&gt; 403 :status_line =&gt; "HTTP/1.1
   403 Forbidden\r\n"
  </code></pre>
  
  <p>upd:I used carrierwave and fog for this and this is my carrierwave config:</p>
  
  <pre><code>CarrierWave.configure do |config|
      config.fog_credentials = {
          :provider               =&gt; 'AWS',
          :aws_access_key_id      =&gt; ENV['S3_ACCESS_KEY'], 
          :aws_secret_access_key  =&gt; ENV['S3_SECRET_KEY'],
        :region                 =&gt; 'us-west-1', # Change this for different AWS region. Default is 'us-east-2'
        :path_style             =&gt; true
  
    }
    config.fog_directory  = "bucket-main1"
    config.fog_public    = true
    config.fog_attributes = {'Cache-Control'=&gt;'max-age=315576000'} 
  
  end
  </code></pre>
  
  <p>And also it works when I push my code to server but doesn't work locally</p>