If you create hash as the following, with default value of a new (identically default-valued) hash: (thanks to Phrogz for the correction; I had the syntax wrong)
hash = Hash.new{ |h,k| h[k] = Hash.new(&h.default_proc) }
Then you can do
hash["a"]["b"] = "c"
without any additional code.