title: All Access to this object has been disabled when using carrierwave/fog to upload to aws s3
body: <p>I'm getting this error when I try to upload to s3. I checked to make sure my aws credentials were correct. Here's the error that i'm getting.</p>
  
  <p>```</p>
  
  <pre><code>Excon::Errors:`:Forbidden: 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;AllAccessDisabled&lt;/Code&gt;&lt;Message&gt;All access to this object has been disabled&lt;/Message&gt;&lt;RequestId&gt;&lt;/RequestId&gt;&lt;HostId&gt;&lt;/HostId&gt;&lt;/Error&gt;"
    :cookies       =&gt; [
    ]
    :headers       =&gt; {
      "Connection"       =&gt; "close"
      "Content-Type"     =&gt; "application/xml"
      "Date"             =&gt; "Fri, 13 May 2016 22:14:48 GMT"
      "Server"           =&gt; "AmazonS3"
      "x-amz-id-2"       =&gt; ""
      "x-amz-request-id" =&gt; ""
    }
    :host          =&gt; "s3.amazonaws.com"
    :local_address =&gt; "10.0.0.24"
    :local_port    =&gt; 57133
    :path          =&gt; "/uploads/script/file/1/Facebook-2006.jpg"
    :port          =&gt; 443
    :reason_phrase =&gt; "Forbidden"
    :remote_ip     =&gt; "54.231.114.148"
    :status        =&gt; 403
    :status_line   =&gt; "HTTP/1.1 403 Forbidden\r\n"
  </code></pre>
  
  <p>```</p>
  
  <p>And this is how I configured carrierwave/fog
  config/initializer/carrierwave.rb
  <code>
  CarrierWave.configure do |config|
    config.fog_credentials = {
      provider: "AWS",
      aws_access_key_id: ENV["AWS_ACCESS_KEY_ID"],
      aws_secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"]
    }
    config.fog_directory = ENV["AWS_S3_BUCKET"]
  end
  </code></p>