If you want to use the Interactive Ruby shell (IRB), you can start it in NetBeans by choosing Window > Other > Ruby Shell (IRB). IRB opens in a tabbed window at the bottom of the IDE in the same location as the Output window.
NetBeans IRB uses the JRuby interpreter to process Ruby code that you type in the window. It works much like the version of irb that comes with Ruby: At the IRB prompt, you type Ruby code and press Enter, and you see the results right away.
For example, type the following code:
def hello; "hello world"; end; hello
Press Enter, and you see
=> hello world
You can also type each of these elements on a line by itself and press Enter to get the same result.
NetBeans IRB maintains a history of your command-line entries. Press the Up-Arrow and Down-Arrow keys to scroll through previous entries. When an entry appears next the the prompt, you can edit it or simply press Enter to execute it.
If you want to get more familiar with NetBeans IRB, here are a couple of tutorials to try with it: