Skip to content

Instantly share code, notes, and snippets.

@zakelfassi
Created October 11, 2013 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakelfassi/6929068 to your computer and use it in GitHub Desktop.
Save zakelfassi/6929068 to your computer and use it in GitHub Desktop.
Rails S3 assets_sync configuration cheatsheet
# gemfile
gem 'asset_sync'
# application.rb
config.assets.initialize_on_precompile = true
config.assets.precompile += ['stuff.js', 'stuff.css']
# production.rb
config.assets.enabled = true
config.action_controller.asset_host = "//s3.amazonaws.com/#{ENV['FOG_DIRECTORY']}"
config.assets.prefix = "/production/assets"
# Terminal
heroku labs:enable user-env-compile -a appName
heroku config:set AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx
heroku config:set S3_BUCKET_NAME=xxx
heroku config:add FOG_DIRECTORY=xxx
heroku config:add FOG_PROVIDER=AWS
# If doesn't precompile ...
heroku run rake assets:precompile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment