this sounds like it's most likely a problem of NetBeans not finding
the file. you probably don't really need a big IDE to get started with
ruby...
you could just open up a terminal, and type `ruby
/[path]/[to]/main.rb` (obviously entering the correct path to the
file... if that works, then your problem is with NetBeans.)
any old text editor will do for writing ruby code, though something
with syntax highlighting is definitely a good idea. i use SciTe, which
has a nifty F5 function which will run your script, and an output panel.