diff --git a/CHANGES.md b/CHANGES.md index 0349d126..4eacb238 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ # Changes +* Workaround another issue caused by conflicting versions of both `json_pure` and `json` being loaded. + ### 2024-10-25 (2.7.4) * Workaround a bug in 3.4.8 and older https://github.com/rubygems/rubygems/pull/6490. diff --git a/lib/json/common.rb b/lib/json/common.rb index bb37820a..d79c5024 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -219,7 +219,12 @@ def parse(source, opts = nil) if opts.nil? Parser.new(source).parse else - Parser.new(source, opts).parse + # NB: The ** shouldn't be required, but we have to deal with + # different versions of the `json` and `json_pure` gems being + # loaded concurrently. + # Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs. + # Ref: https://github.com/ruby/json/issues/650 + Parser.new(source, **opts).parse end end