For example:
ruby-1.9.2-p0 > a = ['hello', 'world']
=> ["hello", "world"]
ruby-1.9.2-p0 > "foo" + a
TypeError: can't convert Array into String
from (irb):3:in `+'
from (irb):3
from /Users/peter/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
ruby-1.9.2-p0 > "foo" + a.to_s
=> "foo[\"hello\", \"world\"]"
ruby-1.9.2-p0 > puts "foo" + a.to_s
foo["hello", "world"]
why can't Ruby automatically convert the array to String?