From ee68da7eebc8d01a9510328a0f64abca692f1552 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Thu, 21 Jul 2022 03:33:08 +0200 Subject: [PATCH] Don't eager load active storage in production We don't use active storage, but eager loading it tries to read the config/storage.yml, which doesn't exist, because we don't need it. https://github.com/rails/rails/blob/571b4d5fb9cd254db79e93370d7b208b6d0fd1e4/activestorage/lib/active_storage/engine.rb#L137 https://github.com/rails/rails/blob/571b4d5fb9cd254db79e93370d7b208b6d0fd1e4/activestorage/app/models/active_storage/blob.rb#L354 closes #8371 --- config/environments/production.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index f3f927a8f..ff5ec75b7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -15,6 +15,11 @@ Rails.application.configure do config.eager_load = true config.eager_load_paths += %W[#{config.root}/lib] + # diaspora* does not use ActiveStroage. But eager loading then loads active_storage/blob.rb, + # which then fails if there isn't a config/storage.yml + # This can be removed if we ever want to use ActiveStorage and a storage.yml exists + config.eager_load_namespaces.delete(ActiveStorage::Engine) + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true