Here you can get the latest Ruby distributions in your favorite flavor. The current stable version is 2.0.0-p195.
Three Ways of Installing Ruby
You can get a copy of Ruby in a variety of ways, and different people prefer each of the three methods for different reasons. Each will have a section below, but here’s an overview:
- Compiling from Source is the standard way that software has been delivered for many, many years. This will be most familiar to the largest number of software developers.
- There are a few third party tools to install Ruby. These are often simpler for total newbies or the most advanced of users.
- Finally, A few package management systems support Ruby. This will be most familiar to people who use one operating system for everything, and like to stick to those individual standards.
Finally, if you want to run multiple versions of Ruby on the same machine, check the third party tools section and use rvm. It’s by far the best way to accomplish that, unless you know exactly what you’re doing.
Compiling Ruby — Source code
Installing from the source code is a great solution for when you are comfortable enough with your platform and perhaps need specific settings for your environment. It’s also a good solution in the event that there are no other premade packages for your platform.
If you have an issue compiling Ruby, consider using one of the third party tools in the next section. They may help you.
- Ruby 2.0.0-p195 (md5: 0672e5af309ae99d1703d0e96eff8ea5) Stable
- Ruby 1.9.3-p429 (md5: 993c72f7f805a9eb453f90b0b7fe0d2b) Previous
- Stable Snapshot This is a tarball of the latest snapshot of the Stable branch (ruby_2_0_0).
- Nightly Snapshot This is a tarball of whatever is in svn, made nightly. This may contain bugs or other issues, use at your own risk!
For information about the Ruby Subversion and Git repositories, see our Ruby Core page.
Third Party Tools
Many Rubyists use third-party tools to help them install Ruby. They confer various advantages, but are not officially supported. Their respective communities are very helpful, however.
The most popular tool to install Ruby is RVM, for “Ruby Version Manager.” Not only does it make installing Ruby incredibly easy, it also allows you to install and manage multiple copies of Ruby on your system, as well as multiple alternate implementations of Ruby.
RVM is only available for Mac OS X, Linux, or any UNIX-like operating system. Windows users should check out pik for a similar project, or consider using RubyInstaller, described in the next section.
As of this writing, as long as you have git installed, you can install RVM with:
$ \curl -L https://get.rvm.io | bash -s stable --ruby
For the latest instructions on installing rvm, check out the RVM
installation page. The above command will install both RVM and the
latest version of Ruby. RVM can also install most of the Ruby
implementations listed below. To see all supported versions, type
If you’re on Windows, there’s a great project to help you install Ruby: RubyInstaller. It gives you everything you need to set up a full Ruby development environment on Windows.
To use RubyInstaller, download it from the RubyInstaller download page. Then just use the installer, and you’re done!
If you are installing Ruby in order to use Rails, you should use RailsInstaller which uses RubyInstaller but gives you extra tools that help with Rails development.
Package Management Systems
If you can’t compile your own Ruby, and you don’t want to use a third party tool, you can use your system’s package manager to install Ruby.
Certain members of the Ruby community feel very strongly that you should never use a package manager to install Ruby, and that you should use RVM instead. While the full list of pros and cons are outside of the scope of this page, the most basic reason is that most package managers have older versions of Ruby in their repositories. If you’d like to use the newest Ruby, make sure you use the correct package name, or use RVM instead.
Debian GNU/Linux uses the apt package manager system. (So does Ubuntu.) You can use it like this:
$ sudo apt-get install ruby1.9.1
Yes, this will install Ruby 1.9.2. It has a ‘library compatibility version’ of 1.9.1, hence the name.
If you install the ‘ruby’ package, you’ll get the older Ruby 1.8.
Arch Linux uses a package manager named pacman. To get Ruby, just do this:
$ sudo pacman -S ruby
On other systems, RVM might be the right choice for you, or you can search the package repository for your Linux distro’s manager.
Mac OS X
Ruby 1.8.7 is fully supported in Mac OS X Lion as well as many popular Ruby gems (packages). For details, see the Ruby wiki at MacOS Forge.
Mac OS X Tiger is packaged with version 1.8.2 of Ruby, and Leopard ships with 1.8.6, but, for those who haven’t upgraded to Leopard, there are a number of options for installing the latest version of Ruby.
Many people on Mac OS X use Homebrew as a package manager. It’s really easy to get Ruby:
$ brew install ruby
Also, since OS X is based on Unix, downloading and installing from the
source is just as easy and effective as the other solutions. To help you
with installation of new Ruby versions on OS X, it’s probably a good
idea to use RVM. Type
rvm notes for system-specific information.
For a detailed look at installing Ruby (and Rails), Dan Benjamin’s excellent articles for Tiger, for Leopard, and for Snow Leopard will get you up and running very quickly. On Lion, this article can help you.
Ruby On Solaris and OpenIndiana
Ruby 1.8.7 are available for Solaris 8 through Solaris 10 on Sunfreeware and Ruby 1.8.7 is available at Blastwave. Ruby 1.9.2p0 is also available at Sunfreeware, but this is outdated. Using RVM can get you the latest version of Ruby 1.9.2.
To install Ruby on OpenIndiana, please use the Image Packaging System, or IPS client. This will install the latest Ruby binaries and Rubygems directly from the OpenSolaris network repository for Ruby 1.9. It’s easy:
$ pkg install runtime/ruby-18
Like before, RVM is a good way to obtain Ruby 1.9.2, the latest version.
Other Implementations of Ruby
Ruby, as a language, has a few different implementations. This guide has been discussing the reference implementation, MRI, but there are also others. They are often useful in certain situations, provide extra integration to other languages or environments, or have special features that MRI doesn’t.
Here’s a list:
- JRuby is Ruby atop the JVM (Java Virtual Machine), utilizing the JVM’s optimizing JIT compilers, garbage collectors, concurrent threads, tool ecosystem, and vast collection of libraries.
- Rubinius is ‘Ruby written in Ruby.’ Built on top of LLVM, Rubinius sports a nifty virtual machine that other languages are being built on top of, too.
- MacRuby is a Ruby that’s tightly integrated with Apple’s Cocoa libraries for Mac OS X, allowing you to write desktop applications with ease.
- Cardinal is a “Ruby compiler for Parrot Virtual Machine” (Perl 6).
- IronRuby is an implementation “tightly integrated with the .NET Framework”.
- MagLev is “a fast, stable, Ruby implementation with integrated object persistence and distributed shared cache”.
Some of those implementations, including MRI, follow the guidelines of RubySpec, a “complete executable specification for the Ruby programming language”.