1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Install Ruby on Windows

By

This is images the Windows logo used in Windows Server 2012 and Windows 8. It became the official logo of Windows in September 2012 with Windows Server 2012.
AxG/Windows 8 logo and wordmark.svg/Public Domain

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.
  11. 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.
  1. About.com
  2. Technology
  3. Ruby
  4. Tutorials
  5. Installing Ruby
  6. How to Install Ruby One-Click Installer on Windows

©2014 About.com. All rights reserved.