undefined local variable or method ` ' for main:Object
You are accidentally typing Alt + Space on your Mac, which produces a non-breaking space. Ruby does not consider this as whitespace, but as part of a variable name. It then complains that the variable does not exist.
Some people like to remap Alt + Space to Space in order to prevent this typo.
I personally like to highlight invisible characters in my text editor, so I notice the typo immediately.