title: Asset_Sync not pushing to S3
body: <p>I am building a rails app on heroku, and want to deploy the js, css, and image files to a bucket on Amazon. I haven't found many resources for this, but I am using this (2012) tutorial for guidance; <a href="https://firmhouse.com/blog/complete-guide-to-serving-your-rails-assets-over-s3-with-asset_sync" rel="nofollow">https://firmhouse.com/blog/complete-guide-to-serving-your-rails-assets-over-s3-with-asset_sync</a></p>
  
  <p>The site is mainly css and js at the moment. Here is my code so far;</p>
  
  <p><strong>production.rb</strong></p>
  
  <pre><code>Rails.application.configure do
  
  config.action_controller.asset_host = "http://localize.s3.amazonaws.com"
  
  config.cache_classes = true
  
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  
  config.serve_static_assets = false
  
  config.assets.compress = true
  
  config.assets.compile = false
  
  config.assets.digest = true
  
  end
  </code></pre>
  
  <p><strong>initializers/asset_sync.rb</strong></p>
  
  <pre><code> if defined?(AssetSync)
   AssetSync.configure do |config|
    config.fog_provider = ENV['FOG_PROVIDER']
    config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] 
    config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
    config.fog_directory = ENV['FOG_DIRECTORY']
    config.fog_region = ENV['FOG_REGION']
  
   # Don't delete files from the store
   config.existing_remote_files = "delete"
  
   # Automatically replace files with their equivalent gzip compressed version
   config.gzip_compression = true
  
  # Use the Rails generated 'manifest.yml' file to produce the list of files to
  # upload instead of searching the assets directory.
  config.manifest = true
  
  config.custom_headers = { '.*' =&gt; { cache_control: 'max-age=31536000', expires: 1.year.from_now.httpdate } }
   end
  end
  </code></pre>
  
  <p><strong>Heroku Vars</strong></p>
  
  <pre><code>AWS_ACCESS_KEY_ID:            *****************
  AWS_SECRET_ACCESS_KEY:        *****************************
  FOG_DIRECTORY:                localize
  FOG_PROVIDER:                 AWS
  FOG_REGION:                   us-west-2
  </code></pre>
  
  <p><strong>gemfile</strong></p>
  
  <pre><code>gem 'rails', '4.1.1'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'jquery-rails'
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  
  #aws
  gem "fog", "~&gt;1.20"
  gem 'asset_sync'
  
  group :development do 
      gem 'thin'
  end
  
  group :production do 
    gem 'newrelic_rpm'
    gem 'rails_12factor'
    gem 'pg'
  end 
  </code></pre>
  
  <p><strong>I also ran:</strong></p>
  
  <pre><code>heroku config:add FOG_PROVIDER=AWS AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy
  </code></pre>
  
  <p>Along with</p>
  
  <pre><code>heroku config:add FOG_DIRECTORY=localize
  </code></pre>
  
  <p>And then when I run </p>
  
  <pre><code>bundle exec rake assets:precompile
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>RAILS_ENV=production bundle exec rake assets:precompile
  </code></pre>
  
  <p><strong>I get this output;</strong></p>
  
  <pre><code>rake aborted!
  AssetSync::Config::Invalid: Fog directory can't be blank, Aws access key can't be blank, Aws secret access key can't be blank
  </code></pre>
  
  <p>Anyone who has experience with rails, heroku, and S3 who could guide me in the right direction would be much appreciated. Thanks in advance. </p>