Allan Von Schenkel Allan Von Schenkel - 2 years ago 153
Ruby Question

= gets.chomp ... not working in terminal

puts 'Hi, What\'s Your Name?'
name = gets.chomp
puts = 'Nice, to meet you ' + name

When I run in terminal, it allows me to type in name. "Bob"
But it stops. Does not put "Nice to meet you Bob"

Answer Source


puts = 'Nice, to meet you ' + name


puts 'Nice, to meet you ' + name

otherwise you're storing the result in the variable puts rather than printing it out.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download