How to setup Eclipse for Ruby

How to setup Eclipse for Ruby

Windows

See below for the steps to install and perform some basic configuration of Eclipse in order to be able to efficiently execute Ruby and therefore, WATIR code.

1. [Install Ruby]
2. Install Watir

3. Go to http://www.eclipse.org/downloads/ and download a copy of Eclipse.
Download the "Eclipse IDE for Java Developers" edition, either the 32- or 64-bit version, depending on your CPU & Operating System combination:

Note: you will need a Java runtime environment (JRE) to use Eclipse (Java SE 5 or greater is recommended).
You can grab the JRE from  http://www.eclipse.org/downloads/moreinfo/jre.php.

4.Once the download is complete, unpack the archive. After it's unpacked, you should have 'eclipse' folder with all Eclipse files in it.
Copy the folder to 'Program Files' or anywhere you want to, then open it, and make a shortcut on your desktop to eclipse.exe.

5. Launch Eclipse by clicking on 'Eclipse' shortcut that you've created.
Eclipse will start, and display the Workspace Launcher:


You can choose any location for your workspace, or leave it by default.

6. If all is good and Eclipse is running, you will see this Welcome screen:

7. Now you have to install the "Dynamic Languages Toolkit (DLTK)", which contains the support for Ruby.
Open Help > Install new software. Click on Add button, and add http://download.eclipse.org/technology/dltk/updates/  as an additional repository:

Once Eclipse finds available updates, select and install the following components:

8. Optional: you can also install Subclipse plugin via Help > Install new software > Add button, and adding http://subclipse.tigris.org/update_1.0.x as an additional repository.

9. To open Ruby perspective, go Window > Open Perspective > Other and select Ruby:

10. To configure Ruby interpreter, go Window > Preferences > Ruby > Interpreters.
Click Add button >Browse button, locate and select your Ruby executable ruby.exe, and click Open button.
In my case Ruby is located under under C:\Ruby192\bin\ruby.exe.

Once Ruby interpreter is added, it will looks similar to this:

11. To create a new Watir project, go File > New > Ruby project:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.