Eero Saynatkari
10/18/2006 2:14:00 AM
On 2006.10.18 10:06, James Edward Gray II wrote:
> On Oct 17, 2006, at 7:59 PM, Lovell Mcilwain wrote:
>
> >The snipet of code its referring to is:
> >
> >puts number + ' bottles of beer on the wall, ' number + ' bottles of
> >beer. Take one down pass it around'
>
> You are missing a plus in the above line. You need one right before
> the second `number` to join it into the string.
>
> When you get that far, you will run into a new error (assuming
> `number` is actually numeric). ;)
>
> You need to convert numbers to put them in strings. You can do this
> with the to_s method available to all numbers:
>
> puts '1 + 2 =' + 3.to_s
Or
puts "1 + 2 = #{3}"
To avoid having to #to_s everything manually.