Category Archives: netbeans

Beginning Ruby in Netbeans 6.5.1

The most recent versions of Netbeans (6+) have become very usable and are improving rapidly. Probably not as feature rich as Eclipse but faster and certainly not lacking in professional capability. Netbeans is currently my IDE of choice for ruby and rails development.

I intend to write a series of tutorials for my brother to gently introduce him to programming in ruby.

Lets begin.

Download Netbeans here. You have two choices you can get the Ruby package (about 60mb) or the whole suite (240mb).

Tutorial 1.

  1. Launch Netbeans
  2. File -> New Project..
  3. Select “Ruby Application”. Click “Next”
  4. Give your project a name and a location to save it. In this instance I am calling it “RubyTutorial” and saving it in my “workspace” directory. Click “Finish”.
  5. Now you are in the project environment. In the right pane the tab should say “main.rb”. Click on the “Run” button (or press F6)

The Output pane should be visible now with the words “Hello World”

Congratulations you have just run a basic ruby program.

In the code pane you will see the line:

puts “Hello World”

You can change what is between the quotes to anything you like. Press the run button (or F6) to see what happens. Any line beginning with # is a comment and won’t affect the execution of the program.