So I found a strange solution -

I had .rb files set to open in my text editor by default, and would 
manually open them with the ruby interpreter to run them. The code 
worked fine when I switched it back to opening with ruby by default.

-- 
Posted via http://www.ruby-forum.com/.