From: Jon Garvin Date: 2006-12-28T02:19:37+09:00 Subject: Re: Newbie problem: String can't be coerced into Fixnum You need to convert the age string to a number. If you're coming from Perl, you're used to this being done for you magically. Ruby expects you to do it. Try this... born = t.year - age.to_i Ja Bo wrote: > I am brand new to Ruby and I would greatly appreciate any help you guys > can provide! > > If this is not the correct place to post them please let me know where I > should post these types of questions. > > This very short program is just supposed to take today's date using t = > Time.now and calculating what year the user was born... > > Code: > puts "How old are you?" > age = gets.chomp > > puts name + " is " + age + " years old." > > t = Time.now > born = t.year - age > > puts "You were probably born in " + born + "." > > > Thank you!!! > >