How to convert a string hash to hash only

require ‘yaml’

YAML.load("[1, 2, 2]") # => [1, 2, 2]

Why the below not working and how to do this ?

YAML.load("{1 => 2}") # => {“1 => 2”=>nil}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs