From: Ruwan Budha Date: 2010-09-26T23:03:17+09:00 Subject: Re: Ruby error Brian Candler wrote: > Ruwan Budha wrote: >> Please help me to figure why ruby is throwing following error..... > > I know nothing about Gruff, but I do notice this: > >> x = Hash.new(a.size/inc) > > That probably doesn't do what you think. It says "create a Hash which > returns 5 for any non-existent element" (try puts x[1000] for example) > > Hashes don't have sizes. If you really want a Hash then it should be > > x = Hash.new > > or just > > x = {} worked like a charm....thanx so much... -- Posted via http://www.ruby-forum.com/.