From 36a1174a9d4eba491b1945c088a59b22910102e6 Mon Sep 17 00:00:00 2001 From: Neil Gehani Date: Thu, 19 Sep 2013 20:32:20 -0700 Subject: [PATCH] Add Amazon S3 --- Gemfile | 1 + Gemfile.lock | 7 +++++++ config/environments/production.rb | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/Gemfile b/Gemfile index 90fcbcf..6352714 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem 'jquery-rails' gem 'devise' gem 'simple_form', '~> 3.0.0.rc' gem "paperclip", "~> 3.0" +gem 'aws-sdk' group :production do gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index 67308aa..d29a3dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,6 +27,10 @@ GEM tzinfo (~> 0.3.37) arel (4.0.0) atomic (1.1.14) + aws-sdk (1.18.0) + json (~> 1.4) + nokogiri (< 1.6.0) + uuidtools (~> 2.1) bcrypt-ruby (3.1.2) bootstrap-sass (2.3.2.2) sass (~> 3.2) @@ -64,6 +68,7 @@ GEM mime-types (1.25) minitest (4.7.5) multi_json (1.8.0) + nokogiri (1.5.10) orm_adapter (0.4.0) paperclip (3.5.1) activemodel (>= 3.0.0) @@ -132,6 +137,7 @@ GEM uglifier (2.2.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) + uuidtools (2.1.4) warden (1.2.3) rack (>= 1.0) @@ -139,6 +145,7 @@ PLATFORMS ruby DEPENDENCIES + aws-sdk bootstrap-sass (~> 2.3.2.2) coffee-rails (~> 4.0.0) devise diff --git a/config/environments/production.rb b/config/environments/production.rb index 2210343..6832ec4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -80,4 +80,14 @@ #In production, :host should be set to the actual host of your application. config.action_mailer.default_url_options = { :host => 'localhost:3000' } + + # config heroku to us Amazon S3 to store files + config.paperclip_defaults = { + :storage => :s3, + :s3_credentials => { + :bucket => ENV['AWS_BUCKET'], + :access_key_id => ENV['AWS_ACCESS_KEY_ID'], + :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'] + } +} end