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}