title: Carrierwave / Fog / S3 "is not a recognized storage provider"
body: <p>I have a Rails app that is using Carrierwave for file uploads. It has been working fine but I want to start using Amazon S3 for my image storage. I am getting this error:</p>
  
  <pre><code>ArgumentError ( is not a recognized storage provider):
    app/controllers/salons_controller.rb:52:in `update'
  </code></pre>
  
  <p>I have made sure I have the latest gems for Carrierwave and Fog. This is in my Gemfile:</p>
  
  <pre><code>gem 'carrierwave'
  gem 'aws-sdk'
  gem 'fog'
  </code></pre>
  
  <p>fog.rb looks like:</p>
  
  <pre><code>CarrierWave.configure do |config|
      config.fog_credentials = {
          :provider              =&gt; 'AWS',
          :aws_access_key_id     =&gt; 'MYACCESSKEY',
          :aws_secret_access_key =&gt; 'MYSECRETKACCESSKEY',
          :region                =&gt; 'us-east-1'
      }
  
      config.fog_directory = 'andrunix'
      config.fog_public    = true
      config.fog_attributes = {'Cache-Control'=&gt;'max-age=315576000'} 
  </code></pre>
  
  <p>end</p>
  
  <p>The Uploader class looks like:</p>
  
  <pre><code>class SalonImageUploader &lt; CarrierWave::Uploader::Base
    include CarrierWave::RMagick
    storage :fog
  
    def store_dir
      # "andrunix" is the bucket name on S3
  
      "andrunix/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  end
  </code></pre>
  
  <p>If I change the storage back to 'file', it works fine. Setting storage to 'fog' generates this error. </p>