Creating a nested hash in Ruby gives me errors
===

I tried to create a nested hash in several ways as mentioned in 
http://www.dzone.com/snippets/create-nested-hashes-ruby

    # From: http://www.ruby-forum.com/topic/111524
    # Author: Daniel Martin
    
    a = Hash.new{|h,k| h[k]=Hash.new(&h.default_proc) }
    
    a[2][1]=2
    a[2][2][3]=4
    a[3][1][1][1]=1
    
    p  a     #=> {2=>{1=>2, 2=>{3=>4}}, 3=>{1=>{1=>{1=>1}}}}
    
    
    # From: http://www.ruby-forum.com/topic/130324
    # Author: Sebastian Hungerecker
    
    blk = lambda {|h,k| h[k] = Hash.new(&blk)}
    x = Hash.new(&blk)
    x[:la][:li][:lu][:chunky][:bacon][:foo] = "bar"

But they keep giving me errors like

    NoMethodError: undefined method `+' for {}:Hash
    	from (irb):66:in `block in irb_binding'
    	from (irb):65:in `each'
    	from (irb):65
    	from /Users/kennetht/.rvm/gems/ruby-1.9.3-p194@fdanalyse/gems/railties-3.2.5/lib/rails/commands/console.rb:47:in `start'
    	from /Users/kennetht/.rvm/gems/ruby-1.9.3-p194@fdanalyse/gems/railties-3.2.5/lib/rails/commands/console.rb:8:in `start'
    	from /Users/kennetht/.rvm/gems/ruby-1.9.3-p194@fdanalyse/gems/railties-3.2.5/lib/rails/commands.rb:41:in `<top (required)>'
    	from script/rails:6:in `require'
    	from script/rails:6:in `<main>'

What is going on?