Skip to content

Instantly share code, notes, and snippets.

@jlee42
Created January 30, 2013 17:59
Show Gist options
  • Save jlee42/4675206 to your computer and use it in GitHub Desktop.
Save jlee42/4675206 to your computer and use it in GitHub Desktop.
CarrierWave.configure do |config|
config.fog_public = false
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
config.cache_dir = "#{Rails.root}/tmp/uploads"
if Rails.env.test? # Use local file system
config.enable_processing = false
config.storage = :file
else # Use Rackspace cloud files
config.storage = :fog
config.fog_credentials = {
:provider => 'Rackspace',
:rackspace_username => ENV['RACKSPACE_USERNAME'],
:rackspace_api_key => ENV['RACKSPACE_API_KEY'],
:rackspace_servicenet => true
}
config.asset_host = 'http://HOST.r22.cf1.rackcdn.com/'
config.fog_directory = ENV['RACKSPACE_CONTAINER_NAME']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment