CINXE.COM
Documentation
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Documentation</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta itemprop="image" content="https://www.ruby-lang.org/images/header-ruby-logo@2x.png"> <meta name="description" content=""> <link rel="stylesheet" type="text/css" href="/stylesheets/normalize.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/main.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/pygments.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/mobile.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/print.css"> <link href='https://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'> <link rel="canonical" href="https://www.ruby-lang.org/en/documentation/"> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> <link href="/en/feeds/news.rss" rel="alternate" title="Recent News (RSS)" type="application/rss+xml"> <script type="text/javascript" src="/javascripts/jquery.min.js"></script> <script type="text/javascript" src="/javascripts/page.js"></script> </head> <body> <div id="header"> <div id="header_content" class="container"> <a href="/en/"> <h1>Ruby</h1> <h2>A Programmer's Best Friend</h2> </a> <div class="site-links"> <a href="/en/" class="home">Home</a> <a href="/en/downloads/">Downloads</a> <a href="/en/documentation/">Documentation</a> <a href="/en/libraries/">Libraries</a> <a href="/en/community/">Community</a> <a href="/en/news/">News</a> <a href="/en/security/">Security</a> <a href="/en/about/">About Ruby</a> <a href="#" class="menu selected">Menu</a> </div> <div id="search-box"> <form id="search-form" action="https://www.google.com/cse"> <table class="fieldset"> <tr> <td> <input class="field" type="text" name="q" size="31" style="background: white url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat" onfocus="this.style.background='white'" onblur="if (/^\s*$/.test(this.value)) this.style.background='white url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat'"/> </td> <td> <input type="hidden" name="cx" value="013598269713424429640:g5orptiw95w" /> <input type="hidden" name="ie" value="UTF-8" /> <input class="button" type="submit" name="sa" value="Search" /> </td> </tr> </table> </form> </div> </div> </div> <div id="page"> <div id="main-wrapper" class="container"> <div id="main"> <div id="content-wrapper"> <h1>Documentation</h1> <div id="content"> <p class="summary">Guides, tutorials, and reference material to help you learn more about Ruby</p> <h3>Installing Ruby</h3> <p>Although you can easily <a href="https://try.ruby-lang.org/">try Ruby in your browser</a>, you can also read the <a href="installation/">installation guide</a> for help on installing Ruby.</p> <h3>Official Ruby Documentation</h3> <p><a href="https://docs.ruby-lang.org/en">docs.ruby-lang.org/en</a>: List of documentation for all Ruby versions released after 2.1.</p> <p><a href="https://docs.ruby-lang.org/en/3.4">docs.ruby-lang.org/en/3.4</a>: Documentation for Ruby 3.4.</p> <p><a href="https://docs.ruby-lang.org/en/master">docs.ruby-lang.org/en/master</a>: Documentation for Ruby’s master branch.</p> <p><a href="https://docs.ruby-lang.org/en/master/extension_rdoc.html">C Extension Guide</a>: In-depth guide for creating C extensions for Ruby.</p> <h3>Getting Started</h3> <dl> <dt><a href="https://try.ruby-lang.org/">Try Ruby</a></dt> <dd>You can try Ruby right in your browser.</dd> <dt><a href="https://pine.fm/LearnToProgram/">Learn to Program</a></dt> <dd>A wonderful little tutorial by Chris Pine for programming newbies. If you don’t know how to program, start here.</dd> <dt><a href="https://www.ruby-lang.org/en/documentation/quickstart/">Ruby in Twenty Minutes</a></dt> <dd>A small Ruby tutorial that should take no more than 20 minutes to complete.</dd> <dt><a href="https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby">The Odin Project</a></dt> <dd>An open source full stack curriculum</dd> <dt><a href="https://exercism.org/tracks/ruby">excercism</a></dt> <dd>120 exercises with automatic analysis and personal mentoring.</dd> <dt><a href="https://www.codecademy.com/learn/learn-ruby">Codecademy</a></dt> <dd>Online code bootcamp with a variety of topics.</dd> </dl> <h3>Manuals / Books</h3> <h4>Beginner</h4> <dl> <dt><a href="https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/">Programming Ruby 3.3</a></dt> <dd>The seminal work on Ruby in English. Recently updated to Ruby 3.3.</dd> <dt><a href="https://www.manning.com/books/the-well-grounded-rubyist-third-edition">The Well-Grounded Rubyist</a></dt> <dd>A tutorial that begins with your first Ruby program and takes you all the way to sophisticated topics like reflection, threading, and recursion.</dd> </dl> <h4>Intermediate</h4> <dl> <dt><a href="https://www.poodr.com/">Practical OOD in Ruby (POODR)</a></dt> <dd>A programmer’s tale about how to write object-oriented code.</dd> </dl> <h4>Expert</h4> <dl> <dt><a href="https://pragprog.com/titles/ppmetr2/metaprogramming-ruby-2/">Metaprogramming</a></dt> <dd>Explains metaprogramming in a down-to-earth style.</dd> <dt><a href="https://patshaughnessy.net/ruby-under-a-microscope">Ruby Under a Microscope (RUM)</a></dt> <dd>An illustrated guide to Ruby internals.</dd> </dl> <h3>Community Documentation</h3> <p>These documentation sites are maintained by the Ruby community.</p> <dl> <dt><a href="https://www.rubydoc.info/">RubyDoc.info</a></dt> <dd>The one-stop web site for reference documentation about Ruby gems and GitHub-hosted Ruby projects.</dd> <dt><a href="https://rubyapi.org/">RubyAPI.org</a></dt> <dd>Easily find and browse Ruby classes, modules, and methods.</dd> <dt><a href="https://www.ruby-doc.org/">ruby-doc.org</a></dt> <dd>Online API documentation</dd> <dt><a href="https://devdocs.io/ruby/">DevDocs.io</a></dt> <dd>Online API documentation</dd> <dt><a href="https://www.zenspider.com/ruby/quickref.html">Ruby QuickRef</a></dt> <dd>The Ruby quick reference</dd> <dt><a href="https://rubyreferences.github.io/">rubyreferences</a></dt> <dd>A full language reference + detailed language changelog.</dd> </dl> <h3>Style Guides</h3> <dl> <dt><a href="https://rubystyle.guide/">rubystyle.guide</a></dt> <dd>RuboCop’s Ruby style guide</dd> <dt><a href="https://github.com/rubocop/ruby-style-guide">RuboCop</a></dt> <dd>Automated enforcement of their style guide.</dd> <dt><a href="https://ruby-style-guide.shopify.dev/">Shopify</a></dt> <dd>Shopify’s Ruby style guide</dd> <dt><a href="https://docs.gitlab.com/ee/development/backend/ruby_style_guide.html">GitLab</a></dt> <dd>Gitlab’s Ruby style guide</dd> <dt><a href="https://github.com/airbnb/ruby">Airbnb</a></dt> <dd>Airbnb’s Ruby style guide</dd> <dt><a href="https://www.w3resource.com/ruby/ruby-style-guide.php">w3resource</a></dt> <dd>W3’s Ruby style guide</dd> </dl> <h1>Tools</h1> <dl> <dt><a href="https://github.com/ruby/irb">IRB</a></dt> <dd>The interactive Ruby Read-Eval-Print-Loop (REPL)</dd> <dt><a href="https://github.com/pry/pry">Pry</a></dt> <dd>An alternative Ruby REPL</dd> <dt><a href="https://github.com/ruby/rake">Rake</a></dt> <dd>A make-like build utility for Ruby.</dd> <dt><a href="https://ruby.github.io/rdoc/RI_md.html">RI</a></dt> <dd>(Ruby Information) is the Ruby command-line utility that gives fast and easy on-line access to Ruby documentation.</dd> <dt><a href="https://github.com/ruby/rbs">RBS</a></dt> <dd>Type Signature for Ruby</dd> <dt><a href="https://github.com/ruby/typeprof">TypeProf</a></dt> <dd>An experimental type-level Ruby interpreter for testing and understanding Ruby code.</dd> <dt><a href="https://github.com/soutaro/steep">Steep</a></dt> <dd>Static type checker for Ruby.</dd> </dl> <h3>Editors and IDEs</h3> <p>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).</p> <p>Here is a list of popular editors used by Rubyists, broken up by learning curve:</p> <ul> <li>Days <ul> <li><a href="https://www.sublimetext.com/">Sublime Text</a> (paid)</li> <li><a href="https://code.visualstudio.com/docs/languages/ruby">Visual Studio Code</a></li> <li><a href="https://zed.dev/">Zed</a></li> </ul> </li> <li>Months <ul> <li><a href="https://www.jetbrains.com/ruby/">RubyMine</a> (paid)</li> </ul> </li> <li>“Years” (as in, you’ll spend years still learning things about it) <ul> <li><a href="https://www.gnu.org/software/emacs/">Emacs</a> with <a href="https://www.emacswiki.org/emacs/RubyMode">Ruby mode</a> or <a href="https://github.com/zenspider/enhanced-ruby-mode/">Enhanced Ruby mode</a></li> <li><a href="https://www.vim.org/">Vim</a> with <a href="https://github.com/vim-ruby/vim-ruby">vim-ruby</a> plugin</li> <li><a href="https://neovim.io/">NeoVim</a></li> </ul> </li> </ul> <p>All of these editors support the Language Server Protocol (LSP), either by default or through their LSP plugins. Shopify’s <a href="https://github.com/Shopify/ruby-lsp">ruby-lsp</a> is one of the most popular language servers for Ruby and <a href="https://shopify.github.io/ruby-lsp/editors.html">supports all of the above editors</a>.</p> <h3>Older Reading / Resources</h3> <p>These links were more prominent but haven’t been updated in ages.</p> <dl> <dt><a href="https://rubykoans.com/">Ruby Koans</a></dt> <dd>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.</dd> <dt><a href="https://www.techotopia.com/index.php/Ruby_Essentials">Ruby Essentials</a></dt> <dd>A free on-line book designed to provide a concise and easy to follow guide to learning Ruby.</dd> <dt><a href="https://poignant.guide">Why’s (Poignant) Guide to Ruby</a></dt> <dd>An unconventional but interesting book that will teach you Ruby through stories, wit, and comics. Originally created by <em>why the lucky stiff</em>, this guide remains a classic for Ruby learners.</dd> <dt><a href="https://learncodethehardway.org/ruby/">Learn Ruby the Hard Way</a></dt> <dd>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.</dd> <dt><a href="https://www.ruby-doc.org/docs/ProgrammingRuby/">Programming Ruby</a></dt> <dd>The seminal work on Ruby in English, this first edition of the <a href="https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/">Pragmatic Programmers’ book</a> is available for free online.</dd> <dt><a href="https://en.wikibooks.org/wiki/Ruby_programming_language">The Ruby Programming Wikibook</a></dt> <dd>A free online manual with beginner and intermediate content plus a thorough language reference.</dd> </dl> </div> </div> <hr class="hidden-modern" /> <div id="sidebar-wrapper"> <div id="sidebar"> <div class="navigation"> <h3><strong>Get Started</strong>, it's easy!</h3> <ul class="menu"> <li><a href="https://try.ruby-lang.org/">Try Ruby! (in your browser)</a></li> <li><a href="/en/documentation/quickstart/">Ruby in Twenty Minutes</a></li> <li><a href="/en/documentation/ruby-from-other-languages/">Ruby from Other Languages</a></li> </ul> </div> <div class="navigation"> <h3><strong>Explore</strong> a new world…</h3> <ul class="menu"> <li><a href="/en/documentation/">Documentation</a></li> <li><a href="https://rubybib.org/">Academic Research</a></li> <li><a href="/en/libraries/">Libraries</a></li> <li><a href="/en/documentation/success-stories/">Success Stories</a></li> </ul> </div> <div class="navigation"> <h3><strong>Participate</strong> in a friendly and growing community.</h3> <ul> <li><a href="/en/community/mailing-lists/">Mailing Lists</a>: Talk about Ruby with programmers from all around the world.</li> <li><a href="/en/community/user-groups/">User Groups</a>: Get in contact with Rubyists in your area.</li> <li><a href="/en/community/weblogs/">Blogs and Newsletters</a>: Read about what’s happening right now in the Ruby community.</li> <li><a href="/en/community/ruby-core/">Ruby Core</a>: Help polish the rough edges of the latest Ruby.</li> <li><a href="https://bugs.ruby-lang.org/">Issue Tracking</a>: Report or help solve issues in Ruby.</li> </ul> </div> <h3>Syndicate</h3> <p><a href="/en/feeds/news.rss">Recent News (RSS)</a></p> </div> </div> <hr class="hidden-modern" /> </div> </div> </div> <div class="container"> <div id="footer"> <div class="site-links"> <a href="/en/" class="home">Home</a> <a href="/en/downloads/">Downloads</a> <a href="/en/documentation/">Documentation</a> <a href="/en/libraries/">Libraries</a> <a href="/en/community/">Community</a> <a href="/en/news/">News</a> <a href="/en/security/">Security</a> <a href="/en/about/">About Ruby</a> </div> <p> This site in other languages: <a href="/bg/">Български</a>, <a href="/de/">Deutsch</a>, <a href="/en/">English</a>, <a href="/es/">Español</a>, <a href="/fr/">Français</a>, <a href="/id/">Bahasa Indonesia</a>, <a href="/it/">Italiano</a>, <a href="/ja/">日本語</a>, <a href="/ko/">한국어</a>, <a href="/pl/">polski</a>, <a href="/pt/">Português</a>, <a href="/ru/">Русский</a>, <a href="/tr/">Türkçe</a>, <a href="/vi/">Tiếng Việt</a>, <a href="/zh_cn/">简体中文</a>, <a href="/zh_tw/">繁體中文</a>. </p> <p><a href="/en/about/website/">This website</a> is proudly maintained by members of the Ruby community.</p> </div> </div> </body> </html>