From 19b95fe4a4a8c024ca5cbe027068709d511197ad Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Tue, 12 Apr 2011 13:01:04 +0800 Subject: [PATCH] fog, aws not supported any more --- Gemfile | 3 +-- Gemfile.lock | 25 ++++++++++++++++--------- app/uploaders/file_uploader.rb | 2 +- config/initializers/s3.rb | 17 +++++++---------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index be955a8..0e22e64 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,7 @@ gem "carrierwave", :git => 'git://github.com/jnicklas/carrierwave.git' gem 'sqlite3-ruby' # S3 support -#gem 'fog' -gem 'aws' +gem 'fog' # ImageMagick: #gem "rmagick", :require => 'RMagick' diff --git a/Gemfile.lock b/Gemfile.lock index 7581d07..5f149a0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,16 +36,22 @@ GEM activesupport (= 3.0.6) activesupport (3.0.6) arel (2.0.9) - aws (2.4.5) - activesupport - http_connection - uuidtools - xml-simple builder (2.1.2) erubis (2.6.6) abstract (>= 1.0.0) - http_connection (1.4.0) + excon (0.6.1) + fog (0.7.2) + builder + excon (>= 0.6.1) + formatador (>= 0.1.3) + json + mime-types + net-ssh (>= 2.1.3) + nokogiri (>= 1.4.4) + ruby-hmac + formatador (0.1.3) i18n (0.5.0) + json (1.5.1) mail (2.2.15) activesupport (>= 2.3.6) i18n (>= 0.4.0) @@ -55,6 +61,8 @@ GEM mini_exiftool (1.3.0) mini_magick (3.2) subexec (~> 0.0.4) + net-ssh (2.1.4) + nokogiri (1.4.4) polyglot (0.3.1) rack (1.2.2) rack-mount (0.6.14) @@ -75,6 +83,7 @@ GEM rake (>= 0.8.7) thor (~> 0.14.4) rake (0.8.7) + ruby-hmac (0.4.0) sqlite3 (1.3.3) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) @@ -83,15 +92,13 @@ GEM treetop (1.4.9) polyglot (>= 0.3.1) tzinfo (0.3.26) - uuidtools (2.1.2) - xml-simple (1.0.15) PLATFORMS ruby DEPENDENCIES - aws carrierwave! + fog mime-types mini_exiftool mini_magick diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index 4b6080f..a2c0325 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 :s3 + storage :fog def cache_dir "#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true' diff --git a/config/initializers/s3.rb b/config/initializers/s3.rb index dacaa3d..ef0e958 100644 --- a/config/initializers/s3.rb +++ b/config/initializers/s3.rb @@ -1,12 +1,9 @@ CarrierWave.configure do |config| - 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'] + 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