Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

Install Ruby on Windows

106 21


This article is obsolete. It describes how to install the Ruby "One-Click Installer," which has since been replaced. However, since the One-Click Installer is still preferred by some, you may prefer to continue reading. If not, please read the new article covering the new installer.

The "one-click installer" bundles the Ruby interpreter, documentation, some popular libraries and a text editor all into one handy installer.

Difficulty: Easy

Time Required: 15 minutes

Here's How:
  1. Download the latest version of the one click installer from either the Ruby download page or the Ruby Installer homepage.
  2. Once the file is finished downloading, execute it and follow the directions in the installer to complete the installation.
  3. Click on Start -> All Programs -> Ruby-xxx-xx.
  4. To start the bundled editor for Ruby files, click on SciTE.
  5. To start the graphical documentation browser, click on fxri.
  6. Right-click in any folder, such as the Desktop or My Documents, and go to New -> Ruby Program.
  7. Give your Ruby program a name, but be sure to keep the .rb extension or it won't be recognized by the interpreter.
  8. Right-click on the file and click Edit.
  9. The SciTE editor should launch with a blank file. Copy the example program from the box below and paste it into the SciTE editor and then click File -> Save.
    #!/usr/bin/env ruby

    puts "Hello world!"
    gets# Wait for the user to hit enter
  10. Go back to the folder in which you started and double-click on the file. If everything went well, you should see a black command-prompt window with the text "Hello world!" displayed.


  1. Hit enter or click the command-prompt's close button to close the window.

Tips:
  1. The fxri program that is bundled in the installer can be used as a Graphical User Interface replacement for the ri (Ruby Interpreter) command you might wish to use. This is particularly helpful for beginners because instead of having to type in a command, the GUI provides you with a clickable widget to perform the same action.
  2. Though there are some great text editors out there for Windows--Notepad++ or Vim come to mind--the SciTE text editor included with the one-click installer is associated with all .rb files and is already set up to edit Ruby files.
Source...

Leave A Reply

Your email address will not be published.