Download and Install Eclipse

Skip this section if you already have Eclipse installed on your system.
One way to install Eclipse would be to use the appropriate package manager for your distribution like aptemerge,yumyast etc. If you want the latest version though, downloading it separately and uncompressing it in the home directory would be an ideal way. In this case, follow these steps:
  1. Download Eclipse from here.
  2. Extract the downloaded file in the home directory(say /home/user).
  3. Make sure atleast the Java runtime(JRE) is installed(complete Java SDK is required to create Java programs from Eclipse) on the system. Go to the extracted directory and run the ‘eclipse’ executable file to check if everything is working properly.

Downloading and Installing Ruby plugin for Eclipse

Follow these steps:
  1. Download the Ruby plugin for Eclipse by selecting a mirror from here
  2. Extract the downloaded file in a temporary directory(say /home/user/temp).
  3. Copy the contents of the extracted directory in the corresponding Eclipse folders:
    /home/user/temp/features/* —-> /home/user/eclipse/features/
    /home/user/temp/plugins/* —-> /home/user/eclipse/plugins/
    (Use the path to the Eclipse installation folder if its not installed in the home directory).
  4. Confirm if the Ruby plugin is successfully installed by starting the eclipse IDE and going to Help->About Eclipse SDK->Plug-in Details.
  5. Scroll down the list of installed plugins to find the Ruby plugin.

Configure the Ruby plugin

Before being able to create Ruby programs from Eclipse, we need to provide it with the information regarding where Ruby is installed. If Ruby is not already installed, then install it first. Then follow these steps:
  1. Start Eclipse IDE and go to Window->Preferances->Ruby->Installed Interpreters->Add.
  2. Enter the following details:
    Interpreter Name: ruby
    Location: /usr/bin/ruby
    To find the location where ruby is installed on your machine, run the following command:
    sh# which ruby
    /usr/bin/ruby
  3. Now go to Window->Preferances->Ruby->Ri/rdoc and enter the following information:
    RDoc Path: /usr/bin/rdoc
    Ri Path: /usr/bin/ri
  4. Fill whatever location you have found out in the earlier step using `which` command.

Creating a Sample Ruby Application From Eclipse

  1. To create a Ruby application, create a Ruby project from File->New->Project
  2. Select Ruby->Ruby Project. Click ‘Next’, enter a project name and click ‘Finish’.