I did use json (1.8.6) with rails 4.2.10
then fix some parsing issue using json (2.9.1) when upgrade to rails 5.2.8.1
maybe works for you as well