aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/active_storage/engine.rb3
-rw-r--r--lib/active_storage/storage_services.yml4
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/active_storage/engine.rb b/lib/active_storage/engine.rb
index c251f522c6..5f0b62809e 100644
--- a/lib/active_storage/engine.rb
+++ b/lib/active_storage/engine.rb
@@ -56,6 +56,9 @@ module ActiveStorage
rescue => e
raise e, "Cannot load `Rails.config.active_storage.service`:\n#{e.message}", e.backtrace
end
+ else
+ raise "No storage service specified for current env (#{Rails.env}). " \
+ "Add config.active_storage.service = :local into your config/environments/#{Rails.env}.rb."
end
end
end
diff --git a/lib/active_storage/storage_services.yml b/lib/active_storage/storage_services.yml
index a93304d88f..c80a3e8453 100644
--- a/lib/active_storage/storage_services.yml
+++ b/lib/active_storage/storage_services.yml
@@ -9,8 +9,8 @@ local:
# Use rails secrets:edit to set the AWS secrets (as shared:aws:access_key_id|secret_access_key)
amazon:
service: S3
- access_key_id: <%= Rails.application.secrets.aws[:access_key_id] %>
- secret_access_key: <%= Rails.application.secrets.aws[:secret_access_key] %>
+ access_key_id: <%= Rails.application.secrets.dig(:aws, :access_key_id) %>
+ secret_access_key: <%= Rails.application.secrets.dig(:aws, :secret_access_key) %>
region: us-east-1
bucket: your_own_bucket