Just an FYI solution, JSON is a subset of YAML. So

  data = YAML.load(json)

T.