Ex9 problem with q%


#1

I have been trying to figure out why ex9 is not working, I’ve double, triple checked to see if it matches the text from the book and it does… any clue? I’m using Ruby version 2.3 if it matters

# Here's some new strange stuff, remember type it exactly.

days = "Mon Tue Wed Thu Fri Sat Sun"
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"

puts = "Here are the days: #{days}"
puts = "Here are the months: #{months}"

puts %q{
There's somethin ggoing on here.
With this weird quote
We'll be able to type as much as we like.
Even 4 lines if we want, or 5, or 6.
}

Cheers,
Tim


#2

Check again. I see two typing errors inside the %q{}


#3

Edited it…saw 2 errors…still doesn’t work.


#4

You’re gonna kick yourself when you find out what it is. So in the future when you have a problem like this start deleting lines until the problem goes away. So if you delete all the lines before the %q then it works. That means it’s a problem with something you wrote above that. If you delete the first two lines of code then it works again. That means it’s those middle two lines. So why are you doing this:

puts =


#5

doh! I will now bang my head against the keyboard 100 times as penance.


#6

I noticed the puts = too afterwards :smile: