title: Carrierwave + Fog (S3) + Heroku: TypeError (can't convert Hash into String)
body: <p>I have an application on Heroku that uses Carrierwave to upload images to S3. The app is running perfectly on local machine but on Heroku throws the following error and fails the uploading to S3:</p>
  
  <pre><code>TypeError (can't convert Hash into String):
  2011-09-23T15:12:07+00:00 app[web.1]:   app/controllers/admin/albums_controller.rb:49:in `create'
  2011-09-23T15:12:07+00:00 app[web.1]:   app/controllers/admin/albums_controller.rb:48:in `create'
  </code></pre>
  
  <p>That line corresponds to the "if @album.save" instruction.</p>
  
  <p>My Albums controller create action is:</p>
  
  <pre><code>def create
  @album = Album.new(params[:album])
  
  respond_to do |format|
    if @album.save
      format.html { redirect_to(admin_album_path(@album), :notice =&gt; 'Àlbum creat correctament.') }
      format.xml  { render :xml =&gt; [:admin, @album], :status =&gt; :created, :location =&gt; @album }
    else
      format.html { render :action =&gt; "new" }
      format.xml  { render :xml =&gt; @album.errors, :status =&gt; :unprocessable_entity }
    end
  end
  end
  </code></pre>
  
  <p>My Carrierwave initializer:</p>
  
  <pre><code>CarrierWave.configure do |config|
      config.fog_credentials = {
        :provider               =&gt; 'AWS', 
        :aws_access_key_id      =&gt; APP_CONFIG['storage']['s3_access'],
        :aws_secret_access_key  =&gt; APP_CONFIG['storage']['s3_secret'],
      }
      config.fog_directory  = 'romeu'
      config.fog_host       = 'http://xxxxx.s3.amazonaws.com'
      config.fog_public     = true
      config.root = Rails.root.join('tmp')
      config.cache_dir = 'carrierwave'
  end
  </code></pre>
  
  <p>My image_uploader.rb:</p>
  
  <pre><code>class ImageUploader &lt; CarrierWave::Uploader::Base
  
  include CarrierWave::MiniMagick
  
  storage :fog
  
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
  
  # Album Cover version
  version :cover do
    process :square_resize =&gt; [150,150]
  end
  
  # Thumb version
  version :thumb do
    process :square_crop =&gt; [80,80]
  end
  
  def square_crop(width, height)
    manipulate! do |img|
      side = [img['width'], img['height']].min
      x = (img['width'] - side) / 2
      y = (img['height'] - side) / 2
      img.crop("#{side}x#{side}+#{x}+#{y}")
      img.resize("#{width}x#{height}")
      img
    end
  end
  
  def square_resize(width, height)
    manipulate! do |img|
      img.resize("#{width}x#{height}")
      img
    end
  end
  
  # Valid list
  def extension_white_list
      %w(jpg jpeg gif png)
  end
  end
  </code></pre>
  
  <p>My config.ru:</p>
  
  <pre><code># This file is used by Rack-based servers to start the application.
  
  require ::File.expand_path('../config/environment',  __FILE__)
  use Rack::Static, :urls =&gt; ['/carrierwave'], :root =&gt; 'tmp'
  run Encen::Application
  </code></pre>
  
  <p>I have inspected the @album object and everything seems okay:</p>
  
  <pre><code>_mounters: 
    :image: !ruby/object:CarrierWave::Mount::Mounter 
      _memoized_option: 
        ? 
          - :mount_on
        : 
  
      column: :image
      integrity_error: 
      options: {}
  
      processing_error: 
      record: *id001
      uploader: !ruby/object:ImageUploader 
        cache_id: 20110923-0810-1-0644
        file: !ruby/object:CarrierWave::SanitizedFile 
          content_type: image/jpeg
          file: /app/tmp/carrierwave/20110923-0810-1-0644/image.jpg
          original_filename: 
        filename: image.jpg
        model: *id001
        mounted_as: :image
        original_filename: image.jpg
        versions: 
          :thumb: !ruby/object: 
            file: !ruby/object:CarrierWave::SanitizedFile 
            cache_id: 20110923-0810-1-0644
              content_type: image/jpeg
              file: /app/tmp/carrierwave/20110923-0810-1-0644/image.jpg
              original_filename: 
            filename: image.jpg
            model: *id001
            mounted_as: :image
            original_filename: image.jpg
            parent_cache_id: 20110923-0810-1-0644
            versions: {}
  
          :cover: !ruby/object: 
            cache_id: 20110923-0810-1-0644
            file: !ruby/object:CarrierWave::SanitizedFile 
              content_type: image/jpeg
              file: /app/tmp/carrierwave/20110923-0810-1-0644/image.jpg
              original_filename: 
            filename: image.jpg
            model: *id001
            mounted_as: :image
  
  attributes: 
  
    title: 
    body: 
      model: *id001
  previously_changed: {}
  readonly: false
  </code></pre>
  
  <p>I have spent a bunch of days intending to resolve that error but unsuccessful, what I am missing?
  Thanks in advance.</p>