Chris Pine book question

Hi All,

In the Chris P. book there is this code:

puts ‘What is your full name?’
name = gets.chomp
puts ‘Did you know there are ’ + name.length + ’ characters’
puts 'in your name, ’ + name + ‘?’

When I run that I get get this:

calc.rb:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
puts ‘Did you…pl name?’

I’m running this version:

ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

Thanks in advance,

Eric

That code looks good. Meaby you are inputting it wrong. Error points to
line 1? Is your file named calc.rb?

Thanks for your reply! I didn’t think this post was up anymore…I had
an email that said it was removed, lol.

I ran the file on another machine and it worked. I think this machine
may just need a reboot, will check it again after I do that.

Cheers

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs