Upgrading to Ruby 3.1 causes Psych::DisallowedClass exception when using YAML.load_file
Symbol is also not allowed per default when loading YAML in Ruby. Therefore, you need to add Symbol to the permitted_classes in your case too when reading the YAML file: hash = YAML.load_file( some_file_name, permitted_classes: [Matrix, OpenStruct, Symbol] ) See the list of default permitted_classes in Psych (the YAML parser used by Ruby). Or, when … Read more