try pure s3

This commit is contained in:
Espen Antonsen 2011-04-12 13:01:39 +08:00
parent 19b95fe4a4
commit f57ae4c0d7
2 changed files with 11 additions and 8 deletions

View file

@ -8,7 +8,7 @@ class FileUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader # Choose what kind of storage to use for this uploader
if ENV['S3_KEY'] if ENV['S3_KEY']
storage :fog storage :s3
def cache_dir def cache_dir
"#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true' "#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true'

View file

@ -1,9 +1,12 @@
CarrierWave.configure do |config| CarrierWave.configure do |config|
config.fog_credentials = { config.s3_access_key_id = ENV['S3_KEY']
:provider => 'AWS', config.s3_secret_access_key = ENV['S3_SECRET']
:aws_access_key_id => ENV['S3_KEY'], config.s3_bucket = ENV['S3_BUCKET']
:aws_secret_access_key => ENV['S3_SECRET'], #config.fog_credentials = {
:region => 'us-east-1' # :provider => 'AWS',
} # :aws_access_key_id => ENV['S3_KEY'],
config.fog_directory = ENV['S3_BUCKET'] # :aws_secret_access_key => ENV['S3_SECRET'],
# :region => 'us-east-1'
#}
#config.fog_directory = ENV['S3_BUCKET']
end end