From f57ae4c0d7d12c40ad73469cfe8523eddcef564e Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Tue, 12 Apr 2011 13:01:39 +0800 Subject: [PATCH] try pure s3 --- app/uploaders/file_uploader.rb | 2 +- config/initializers/s3.rb | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index a2c0325..4b6080f 100644 --- a/app/uploaders/file_uploader.rb +++ b/app/uploaders/file_uploader.rb @@ -8,7 +8,7 @@ class FileUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader if ENV['S3_KEY'] - storage :fog + storage :s3 def cache_dir "#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true' diff --git a/config/initializers/s3.rb b/config/initializers/s3.rb index ef0e958..dacaa3d 100644 --- a/config/initializers/s3.rb +++ b/config/initializers/s3.rb @@ -1,9 +1,12 @@ CarrierWave.configure do |config| - config.fog_credentials = { - :provider => 'AWS', - :aws_access_key_id => ENV['S3_KEY'], - :aws_secret_access_key => ENV['S3_SECRET'], - :region => 'us-east-1' - } - config.fog_directory = ENV['S3_BUCKET'] + config.s3_access_key_id = ENV['S3_KEY'] + config.s3_secret_access_key = ENV['S3_SECRET'] + config.s3_bucket = ENV['S3_BUCKET'] + #config.fog_credentials = { + # :provider => 'AWS', + # :aws_access_key_id => ENV['S3_KEY'], + # :aws_secret_access_key => ENV['S3_SECRET'], + # :region => 'us-east-1' + #} + #config.fog_directory = ENV['S3_BUCKET'] end \ No newline at end of file