Created
March 5, 2014 14:00
-
-
Save harssh-sparkway/9367680 to your computer and use it in GitHub Desktop.
This file contains 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
#Instructions | |
#Add the gems to your Gemfile: | |
gem 'fog' | |
gem 'carrierwave' | |
gem 'rmagick' # optional, for image resizing support | |
# Add the file './config/initializers/carrierwave.rb' for your CarrierWave configuration: | |
# ./config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
config.fog_credentials = { | |
:provider => "AWS", | |
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], | |
} | |
config.fog_directory = ENV['S3_BUCKET'] | |
# use only one of the following 2 settings | |
config.fog_host = "http://#{ENV['S3_BUCKET']}.s3.amazonaws.com" # for no cloudfront | |
config.fog_host = ENV['S3_CDN'] # for cloudfront | |
end | |
# Add your environment variables: | |
$ heroku config:add AWS_ACCESS_KEY_ID=[your_access_key_here] | |
$ heroku config:add AWS_SECRET_ACCESS_KEY=[your_access_key_here] | |
$ heroku config:add S3_BUCKET=[your_s3_bucket] | |
$ heroku config:add S3_CDN=[your_cloudfront_url] # optional for cloudfront support |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment