I don't know a whole lot about Ruby, but the compile command is not really for meant for interactive commands.
Try
and then the Ruby command that runs/loads a file (there might also be a binding for doing that, try C-h m in a Ruby buffer to get some more help) in the buffer that pops up.
PS: please use [code] tags.
M-x means esc-x in Emacs notation (On most systems alt-x also produces M-x) and C-x means ctrl-x for any character x.