diff --git a/activesupport/lib/active_support/configuration_file.rb b/activesupport/lib/active_support/configuration_file.rb index 0ec499afbc..7f8c5dc8e2 100644 --- a/activesupport/lib/active_support/configuration_file.rb +++ b/activesupport/lib/active_support/configuration_file.rb @@ -19,7 +19,12 @@ module ActiveSupport end def parse(context: nil, **options) - YAML.load(render(context), **options) || {} + source = render(context) + begin + YAML.load(source, aliases: true, **options) || {} + rescue ArgumentError + YAML.load(source, **options) || {} + end rescue Psych::SyntaxError => error raise "YAML syntax error occurred while parsing #{@content_path}. " \ "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \