Thanks to http://rubyinstaller.org, installing Ruby on Windows 7 is painless and fast. This guide will walk you through the process of installing Ruby while pointing out tips along the way. As new versions of Ruby are released, we will update this guide with the latest information.
What’s up with Ruby Versioning?
In December of 2013, the Ruby team decided to make a change to their versioning convention. Prior to the change, when a new milestone version of Ruby was released, it was released as Ruby 1.9.3-p0, where the “p0” part represented the number of patches applied since the initial release. As bug fixes and features were added, internal patch releases would be created and, at some point, one would be designated as a release for the public.
As of 2.1.0, the Ruby team started using Semantic Versioning. This is a welcomed change and should make things cleaner going forward. You can read more about this on the Ruby version policy change announcement page.
Should I Install 32bit or 64bit Ruby
If you are running 32bit Windows 7, then the choice is simple - install 32bit Ruby. If you have 64bit Windows, you have the option of installing either version of Ruby. The choice will depend somewhat on the other software packages you intend to use. For example, if you want to use 64bit MySQL, then you should use 64bit Ruby as well. We have successfully run both versions of Ruby on Windows 7 64bit.
Step 1: Choose The Version of Ruby To Install
Head on over to the Ruby Installer Downloads (http://rubyinstaller.org/downloads/) page. The latest installers are listed on the top left column of the page for each major version of Ruby. If you want to install an older patch level of Ruby, you can visit the Archives page (http://rubyinstaller.org/downloads/archives) and get an older installer as well.
Where is the Installer for Ruby 2.1.1 and Ruby 2.1.2?
These versions of Ruby had bugs which prevented Ruby from working correctly on Windows based platforms. As a result, the Ruby Installer team decided not to release installers until the issues were resolved (fortunately these bugs have been addressed in Ruby 2.1.3). More information can be found in this Google Groups discussion.
Step 2: Download and Run the Installer
We will use the 64bit 2.2.2 version of Ruby which can be found on the Ruby Installer downloads page. Download the installer and run the executeable.
The Ruby installer recommends using a folder name that DOES NOT have spaces; the default directory of C:\Ruby22-x64 is a sensible choice. We recommend checking all three optional boxes, but at the very least you will probably want to Add Ruby executables to your PATH.
Step 3: Test the Installation
Open up a Command Prompt and execute:
The result should be something like:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]
If for some reason the ruby command doesn’t work it’s most likely an issue with the PATH. Execute the following code and make sure the path includes C:\Ruby22-x64\bin.
If it’s not there, add it to your path. Here’s a good tutorial on how to do this.
Step 4: Update Ruby Gems (Optional)
You’re more than likely going to be working with some Ruby Gems in the future so you might as well update to the latest version of Ruby Gems at this point. To find the current installed version of RubyGems, open up your console and execute:
Next, to perform the upgrade, execute:
gem update --system
If you get a fetch error mentioning that SSL cannot connect, you may need to take an additional step. Create the following temporary file c:\ProgramData\.gemrc and add the following line:
Now rerun the above update command. Once the update completes, you either remove the gemrc file or leave the file and delete the ssl_verify_mode line. (You may want to leave the file around because it’s the place where you can customize ruby gems settings.)That’s it, you should have a working installation of Ruby on your Windows box!
You’ll almost certainly want to install the Ruby DevKit now that you have a working installation of Ruby. Certain Ruby Gems need the DevKit to be in place before they can be installed on Windows. See our article, Install Ruby DevKit on Windows 7, for more information.
We hope you found this article useful. If you see any mistakes, missing features or ways to improve it, please let us know in the comments below so we can update its contents. If you're willing to link to us, we would sincerely appreciate it!