Okay, the json gem was ultimately a major problem. Now using ActiveSupport::JSON.decode instead of JSON.parse. Much better.