Cannot run Ruby code that I know works

Atom (or is it Levels?) cannot parse my Ruby program. I tried to find the cause online, but no luck. Any suggestions are appreciated:

This code works fine when I run it in PowerShell