Installing Ruby On Windows

To run Ruby on Windows, you have to install Ruby and several developer tools. The following instructions have been tested with Windows 8 and 8.1.

Rails Installation on Windows. Follow the steps given below for installing Ruby on Rails. Step 1: Check Ruby Version. First, check if you already have Ruby installed. Open the command prompt and type ruby -v. If Ruby responds, and if it shows a version number at or above 2.2.2, then type gem -version. If you don't get an error, skip Install. RubyInstaller is the easiest and most used Ruby environment on Windows. And Ruby is a great language for beginners as well as professionals. It’s suitable for small scripts as well as large applications. RubyInstaller combines the possibilities of native Windows programs with the rich UNIX toolset of MSYS2 and the large repository of MINGW. Instructor If you're following this courseand you're going to be working on Windows,then you'll need to first make sure you have Ruby installed.By default, Ruby is not installed on Windows,so you need to take some additional stepsunless you've done this before.There's another course in the librarythat can help you to get things installed.It's called Installing. On Windows machines, you can use RubyInstaller. See the Installation page for details on using package management systems or third-party tools. Of course, you can also install Ruby from source on all major platforms. Jun 07, 2019  Ruby is a well-established and well-regarded programming language.Once upon a time, installing Ruby on Windows came with problems, but things have come a long way. Today, there’s no reason someone couldn’t write Ruby code on any platform. While there are many ways to set up Ruby on Windows, Microsoft recommends that you use the Windows Subsystem for Linux (WSL) and Bash to do your Ruby development. WSL is a Windows 10 feature that lets you run native Linux command line tools on Windows. Many Ruby libraries are designed to run on Linux, and can exhibit problems when run on Windows.

RubyInstaller is the easiest and most used Ruby environment on Windows. And Ruby is a great language for beginners as well as professionals. It’s suitable for small scripts as well as large applications. RubyInstaller combines the possibilities of native Windows programs with the rich UNIX toolset of MSYS2 and the large repository of MINGW.

  1. Go to Ruby Installer in your web browser.

  2. Click the big red Download button.

    A list of RubyInstallers appears.

  3. Click Ruby 2.2.2 near the top of the RubyInstallers list.

    Do not click Ruby 2.2.2 (x64).

    An installer program downloads to your computer.

  4. Run the installer program by choosing Run Program (if Windows presents this option) or double-clicking the file when it’s done downloading.

    The installer will ask you to select a language to use during installation. Accept the license, and then the installer will have you set some configuration options. Leave the default folder choice alone, but uncheck the Install Tcl/Tk Support check box, and make sure that the other two check boxes — Add Ruby Executables to Your PATH and Associate .rb and .rbw Files with This Ruby Installation — are selected.

When the installer is done, it will have created a topmost folder with all the Ruby software on your C: drive called C:Ruby22. You can use Windows 8 Desktop and the File Explorer to confirm that it’s there (as shown here).

Installing

You must also download the Development Kit from Ruby Installer to get some of the cool tools used by your Ruby projects. Follow these steps:

  1. Go to the Ruby Installer in your web browser.

  2. Scroll down to the Development Kit section and click the file under “For use with Ruby 2.0 and above (32bits version only)”.

    Download the Development Kit for Ruby 2.0 and above. Be sure to click the 32bits version.

    An installer program downloads to your computer.

  3. Run the Development Kit installer by choosing Run Program (if Windows presents this option) or double-clicking the file when it finishes downloading.

    The installer will ask you where to put the kit. You want to put the kit in its own folder, not in the Ruby folder you selected in Step 1. To make things easy for your projects, select a folder next to the Ruby22 one at the top of your C: drive.

  4. Enter C:DevKit for the location, as shown here.

Now you need some final setup. Follow these steps:

  1. Open your Windows launch screen (or use the Start Menu).

  2. Click the Start Command Prompt with Ruby program.

    If you have a lot of programs installed in your launch screen, use the search feature and type command to help narrow down the choices.

    In the command prompt application, you type commands to get things done. Typing commands is a low-level way of working with a computer. Before the mouse and graphical interface was invented, this was the only way to tell the computer what to do!

  3. Change your location to the Developer Kit folder.

    When you first open the command prompt application, you’re usually in your home directory. To complete setup, you need to move to the DevKit directory. The display will show you a prompt that gives a hint of where you’re starting from:

    Remember, you don’t need to type the prompt part, just the command line itself.

    Change folders by typing cd DevKit and pressing the Enter key to tell the computer you’re done with that command.

    You see the prompt change to your new location:

  4. Use Ruby to set up more Ruby tools.

    Development Kit has a Ruby setup program called dk.rb that you use for a couple of different steps. Enter the first command and watch for it to complete, as shown.

    If you see the Initialization complete! message, Development Kit is ready to finish installing its tools.

  5. Enter the install command and wait for it to complete:

    Phew! You only have to do these commands once to get your computer ready for Ruby programming and you’re almost there!

  6. The Development Kit is ready and now you can install Ruby gems (little add-on enhancements for Ruby).

    Enter the command and review the progress messages:

    You may get a Windows security warning saying that Ruby is trying to use the network. This is okay — you can select the default values in the dialog box. You may have to enter your password to dismiss the dialog box.

Wow, that was a lot, but now you have Ruby installed!

Installing Ruby Gem On Windows

Now you will want a code editor to help make writing your programs easy:

  1. In your browser, go to Atom and click the Download Windows Installer button.

    Atom is a free, powerful code editor that can be used for programming many different computer languages. It works well with Ruby.

    An installer program downloads to your computer.

  2. Run the Atom installer by choosing Run Program (if Windows presents this option) or double-clicking the installer program when it finishes downloading.

    You see a progress dialog box. When the installer is done, the Atom editor starts up.

    You see the Atom welcome screen, which means you’re all set to start programming with Ruby!

Install Ruby On Windows Bash

Ruby is constantly being updated and improved. The current release of Ruby at the time of this writing is version 2.2.2. Ruby uses a versioning scheme where the first number is the major version, the second number is the minor version, and the third number is the current build number (sometimes called the patch number).

On Windows, to utilize the game programming library Gosu, it’s important to select the version of Ruby and the Development Kit that indicate they are 32 bit.