I tried your code and discovered that the extra space after the exclamation mark before the quotation mark gave me same error as yours. Remove that space and it resolves.
See below:
favorite_things = ["Ruby", "espresso", "candy"]
puts "A few of my favorite things:"
favorite_things.each do |thing|
puts "I love #{thing}!"
end