Download Ruby

Ruby is an open source and general-purpose programming language with a focus on simplicity and productivity. In Ruby, everything is an object, including primitive data types. It is interpreted, high-level, and dynamically typed; its interpreter uses garbage collection and just-in-time compilation. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

Ruby releases

Here you can get the latest Ruby distributions in your favorite flavor. The current stable version is 3.4.4. Please be sure to read Ruby’s License.

For more information about specific releases, particularly older releases or previews, see the Releases page. Information about the current maintenance status of the various Ruby branches can be found on the Branches page.

For information about the Ruby Subversion and Git repositories, see the Ruby Core page.

The Ruby source is available from a worldwide set of Mirror Sites. Please try to use a mirror that is near you.

Installing Ruby

There are several tools on each major platform to install Ruby:

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.

Compiling Ruby from 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.

See the Installation page for details on building Ruby from source. If you have an issue compiling Ruby, consider using one of the third party tools mentioned above. They may help you.

Libraries

As with most programming languages, Ruby leverages a wide set of third-party libraries.

Nearly all of these libraries are released in the form of a gem, a packaged library or application that can be installed with a tool called RubyGems.

RubyGems is a Ruby packaging system designed to facilitate the creation, sharing and installation of libraries (in some ways, it is a distribution packaging system similar to, say, apt-get, but targeted at Ruby software). Ruby comes with RubyGems by default since version 1.9, previous Ruby versions require RubyGems to be installed by hand.

Some other libraries are released as archived (.zip or .tar.gz) directories of source code. Installation processes may vary, typically a README or INSTALL file is available with instructions.

Let’s take a look at finding libraries and installing them for your own use.

Finding libraries

The main place where libraries are hosted is RubyGems.org, a public repository of gems that can be searched and installed onto your machine. You may browse and search for gems using the RubyGems website, or use the gem command.

Using gem search -r, you can search RubyGems’ repository. For instance, gem search -r rails will return a list of Rails-related gems. With the --local (-l) option, you would perform a local search through your installed gems. To install a gem, use gem install [gem]. Browsing installed gems is done with gem list. For more information about the gem command, see below or head to RubyGems’ docs.

There are other sources of libraries though. GitHub is the main Ruby-related content repository. Most often a gem source code will be hosted on GitHub while being published as a fully-fledged gem to RubyGems.org.

The Ruby Toolbox is a project that makes it easy to explore open source Ruby projects. It has categories for various common development tasks, collects a lot of information about the projects like release and commit activity or dependencies and rates projects based on their popularity on RubyGems.org and GitHub. This makes it easy to find a gem which solves a particular problem such as web frameworks, documentation tools and code quality libraries.

A few more words about RubyGems

Here is a quick review of the gem command for your daily use. More detailed documentation is available, covering all aspects of this packaging system.

Searching among available gems

The search command can be used to look for gems, based on a string. Gems which names start with the specified string will be listed in return. For instance, to search for the “html”-related gems:

                    $ gem search -r html *** REMOTE GEMS *** html-sample (1.0, 1.1)
                

The --remote / -r flag indicates that we want to inspect the official RubyGems.org repository (default behaviour). With the --local / -l flag you would perform a local search among your installed gems.

Installing a gem

Once you know which gem you would like to install, for instance the popular Ruby on Rails framework:

                    $ gem install rails
                

You can even install just a specific version of the library, using the --version / -v flag:

                    $ gem install rails --version 5.0
                

Listing all gems

For a list of all locally installed gems:

                    $ gem list
                

To obtain a (very long) list of all gems available on RubyGems.org:

                    $ gem list -r
                

Help!

Documentation is available inside your terminal:

                    $ gem help
                

For instance, gem help commands is very useful as it outputs a list of all gem’s commands.

Crafting your own gems

RubyGems.org has several guides about this topic. You may also want to investigate Bundler, a generic tool which helps you manage an application’s dependencies and may be used along RubyGems.

Documentation

Guides, tutorials, and reference material to help you learn more about Ruby.

Installing Ruby

Although you can easily try Ruby in your browser, you can also read the installation guide for help on installing Ruby.

Official Ruby Documentation

docs.ruby-lang.org/en
List of documentation for all Ruby versions released after 2.1.
docs.ruby-lang.org/en/3.4
Documentation for Ruby 3.4.
docs.ruby-lang.org/en/master
Documentation for Ruby’s master branch.
C Extension Guide
In-depth guide for creating C extensions for Ruby.

Getting Started

Try Ruby
You can try Ruby right in your browser.
Learn to Program
A wonderful little tutorial by Chris Pine for programming newbies. If you don’t know how to program, start here.
Ruby in Twenty Minutes
A small Ruby tutorial that should take no more than 20 minutes to complete.
The Odin Project
An open source full stack curriculum
excercism
120 exercises with automatic analysis and personal mentoring.
Codecademy
Online code bootcamp with a variety of topics.

Manuals / Books

Beginner

Programming Ruby 3.3
The seminal work on Ruby in English. Recently updated to Ruby 3.3.
The Well-Grounded Rubyist
A tutorial that begins with your first Ruby program and takes you all the way to sophisticated topics like reflection, threading, and recursion.

Intermediate

Practical OOD in Ruby (POODR)
A programmer’s tale about how to write object-oriented code.

Expert

Metaprogramming
Explains metaprogramming in a down-to-earth style.
Ruby Under a Microscope (RUM)
An illustrated guide to Ruby internals.

Community Documentation

These documentation sites are maintained by the Ruby community.

RubyDoc.info
The one-stop web site for reference documentation about Ruby gems and GitHub-hosted Ruby projects.
RubyAPI.org
Easily find and browse Ruby classes, modules, and methods.
ruby-doc.org
Online API documentation
DevDocs.io
Online API documentation
Ruby QuickRef
The Ruby quick reference
rubyreferences
A full language reference + detailed language changelog.

Style Guides

rubystyle.guide
RuboCop’s Ruby style guide
RuboCop
Automated enforcement of their style guide.
Shopify
Shopify’s Ruby style guide
GitLab
Gitlab’s Ruby style guide
Airbnb
Airbnb’s Ruby style guide
w3resource
W3’s Ruby style guide

Tools

IRB
The interactive Ruby Read-Eval-Print-Loop (REPL)
Pry
An alternative Ruby REPL
Rake
A make-like build utility for Ruby.
RI
(Ruby Information) is the Ruby command-line utility that gives fast and easy on-line access to Ruby documentation.
RBS
Type Signature for Ruby
TypeProf
An experimental type-level Ruby interpreter for testing and understanding Ruby code.
Steep
Static type checker for Ruby.

Editors and IDEs

For coding in Ruby, you can use the default editor of your operating system. By the way, to be more effective in coding, it is worth choosing a source code editor with basic Ruby support (e.g. syntax-highlighting, file browsing) or an integrated development environment with advanced features (e.g. code completion, refactoring, testing support).

Here is a list of popular editors used by Rubyists, broken up by learning curve:

All of these editors support the Language Server Protocol (LSP), either by default or through their LSP plugins. Shopify’s ruby-lsp is one of the most popular language servers for Ruby and supports all of the above editors.

Older Reading / Resources

These links were more prominent but haven’t been updated in ages.

Ruby Koans
The Koans walk you along the path to enlightenment in order to learn Ruby. The goal is to learn the Ruby language, syntax, structure, and some common functions and libraries. We also teach you culture.
Ruby Essentials
A free on-line book designed to provide a concise and easy to follow guide to learning Ruby.
Why’s (Poignant) Guide to Ruby
An unconventional but interesting book that will teach you Ruby through stories, wit, and comics. Originally created by why the lucky stiff, this guide remains a classic for Ruby learners.
Learn Ruby the Hard Way
A very good set of exercises with explanations that guide you from the absolute basics of Ruby all the way to OOP and web development.
Programming Ruby
The seminal work on Ruby in English, this first edition of the Pragmatic Programmers’ book is available for free online.
The Ruby Programming Wikibook
A free online manual with beginner and intermediate content plus a thorough language reference.

Apache/2.4.63 (Debian) Server at mirror.timecapsule.one Port 443