I've found one question like this on stackoverflow, but it doesn't answer my question.
I'm following along with http://www.ruby-doc.org/docs/ProgrammingRuby/ to learn Ruby, but I'm running into problems with the example code and it's frustrating.
person = "Tim"
puts person.id
puts person.type
puts person
The error message I'm getting is:
C:/Users/g3k/Desktop/Ruby/person.rb:2:in `<main>': undefined method `id' for "Tim":String (NoMethodError)
Obviously I'm running Windows (Vista) and I'm running ruby 1.9.2p0 (2010-08-18) [i386-mingw32]. I'm wondering my problem is because the book is outdated and Ruby has had some time to mature since this book came out (the second edition is available for purchase at this point)
I had the same problem with .id in a Jukebox example code, but I figured it was a fluke and continued. I understand what the error is, but I don't understand why.