From f6a95ddac53ca001b3760369d7be960b20615959 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 17 Jul 2015 18:26:43 -0400 Subject: [PATCH] oooops, carrierwave wants s3 config in prod, too --- config/initializers/carrierwave.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 264719dc..305d4111 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -4,15 +4,11 @@ CarrierWave.configure do |config| if Rails.env.production? - s3_config = YAML.load_file Rails.root.join('config', 'aws_s3.yml') - access_key_id = s3_config['access_key_id'] - secret_access_key = s3_config['secret_access_key'] - config.storage = :fog config.fog_credentials = { :provider => 'AWS', - :aws_access_key_id => access_key_id, - :aws_secret_access_key => secret_access_key + :aws_access_key_id => ENV.fetch('AWS_ACCESS_KEY_ID'), + :aws_secret_access_key => ENV.fetch('AWS_SECRET_ACCESS_KEY') } else config.storage = :file