Closed jwmeigs closed 1 year ago
NOTE: My mistake. Rails 6.1 only supports Ruby 3.0.x.
This is still an issue with Rails 7.0.x and Ruby 3.1.x
This is fixed in the develop branch but not yet released, AFAIK. For now I patch around it by having this in an initializer:
class ThinkingSphinx::Settings
# Ruby 3.1 ships with Psych 4, which no longer allows aliases in yml by default.
# We'd like to be able to use them in thinking_sphinx.yml
module YAML
def self.load(str, **args)
::YAML.load(str, aliases: true, **args)
end
# The unreleased version of TS (> 5.4.0) has started to use safe_load.
def self.safe_load(...)
puts "You can remove this patch now #{__FILE__}"
::YAML.safe_load(...)
end
end
end
My apologies for the delay, just published v5.5.0 with the fix.
Also, thanks @jwmeigs for reporting the problem! :)
YAML.load now aliases safe_load and also doesn't load the aliases without the aliases: true option.
https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
This is in settings.rb line 103