Closed hieuk09 closed 2 years ago
When upgrading my project to ruby 3.1, I got this error:
Psych::BadAlias: Unknown alias: local # ./vendor/bundle/ruby/3.1.0/gems/symmetric-encryption-4.4.0/lib/symmetric_encryption/config.rb:78:in `config' # ./vendor/bundle/ruby/3.1.0/gems/symmetric-encryption-4.4.0/lib/symmetric_encryption/config.rb:88:in `ciphers' # ./vendor/bundle/ruby/3.1.0/gems/symmetric-encryption-4.4.0/lib/symmetric_encryption/config.rb:22:in `load!' # ./vendor/bundle/ruby/3.1.0/gems/symmetric-encryption-4.4.0/lib/symmetric_encryption/symmetric_encryption.rb:294:in `load!' # ./config/initializers/symmetric_encryption.rb:1:in `<top (required)>'
In release note of ruby 3.1, it mentioned that safe_load is now the default behavior of Yaml.load, which doesn't load aliases. I updated the code to include aliases: true by when loading the configuration to retain the existing logic of the gem.
safe_load
Yaml.load
aliases: true
Issue
When upgrading my project to ruby 3.1, I got this error:
Description of changes
In release note of ruby 3.1, it mentioned that
safe_load
is now the default behavior ofYaml.load
, which doesn't load aliases. I updated the code to includealiases: true
by when loading the configuration to retain the existing logic of the gem.