Created
October 11, 2013 03:16
-
-
Save zakelfassi/6929068 to your computer and use it in GitHub Desktop.
Rails S3 assets_sync configuration cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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