From 459445be23d44fe7ab0d1a21d9adab36760c700a Mon Sep 17 00:00:00 2001 From: Noah Silvera Date: Tue, 8 Sep 2026 15:06:18 -0400 Subject: [PATCH] Pin JSON to < 3 to prevent Rails incompatibilities In JSON 3.0.0, passing the `quirks_mode` keyword to methods was changed from a silent failure to a loud failure - https://github.com/ruby/json/commit/ebf0f2901c162eb0b3008001a50ba378199a0a2f The use of the JSON `quirks_mode` was removed from rails in v8.1.0, however there is still another incompatibility between Rails 8.1 and JSON 3. https://github.com/rails/rails/commit/646f1745e6e9a47c8c70728da68d30825b2d51c6#diff-c202bc84686ddd83549f9603008d8fb9f394a05e76393ff160b7c9494165fc4a This is a temporary fix to stop JSON from resolving to 3 until JSON and Rails resolve their compatibility issues. Co-Authored-By: Adam Mueller Co-Authored-By: Alistair Norman --- admin/solidus_admin.gemspec | 2 ++ core/solidus_core.gemspec | 1 + 2 files changed, 3 insertions(+) diff --git a/admin/solidus_admin.gemspec b/admin/solidus_admin.gemspec index d9290e887de..c72c5815dcb 100644 --- a/admin/solidus_admin.gemspec +++ b/admin/solidus_admin.gemspec @@ -30,6 +30,8 @@ Gem::Specification.new do |s| s.add_dependency "blueprinter" s.add_dependency "geared_pagination", "~> 1.1" + # Rails < 8.1 isn't compatible with json 3.x + s.add_dependency "json", "< 3" s.add_dependency "importmap-rails", [">= 2.0", "< 3"] s.add_dependency "solidus_backend" s.add_dependency "solidus_core", "> 4.2" diff --git a/core/solidus_core.gemspec b/core/solidus_core.gemspec index a5c5d947fc4..705b6479ed4 100644 --- a/core/solidus_core.gemspec +++ b/core/solidus_core.gemspec @@ -42,6 +42,7 @@ Gem::Specification.new do |s| s.add_dependency "discard", "~> 2.0" s.add_dependency "friendly_id", "~> 5.0" s.add_dependency "image_processing", "~> 1.10" + s.add_dependency "json", "< 3" s.add_dependency "mini_magick", "~> 4.10" s.add_dependency "monetize", "~> 1.8" s.add_dependency "kt-paperclip", [">= 6.3", "< 8.1"]