CINXE.COM

Official Ruby FAQ

<!DOCTYPE html> <html> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("https://www.ruby-lang.org/en/documentation/faq/","20240715203327","https://web.archive.org/","web","/_static/", "1721075607"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="utf-8"> <title>Official Ruby FAQ</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta itemprop="image" content="https://web.archive.org/web/20240715203327im_/https://www.ruby-lang.org/images/header-ruby-logo@2x.png"> <meta name="description" content=""> <link rel="stylesheet" type="text/css" href="/web/20240715203327cs_/https://www.ruby-lang.org/stylesheets/normalize.css"> <link rel="stylesheet" type="text/css" href="/web/20240715203327cs_/https://www.ruby-lang.org/stylesheets/main.css"> <link rel="stylesheet" type="text/css" href="/web/20240715203327cs_/https://www.ruby-lang.org/stylesheets/pygments.css"> <link rel="stylesheet" type="text/css" href="/web/20240715203327cs_/https://www.ruby-lang.org/stylesheets/mobile.css"> <link rel="stylesheet" type="text/css" href="/web/20240715203327cs_/https://www.ruby-lang.org/stylesheets/print.css"> <link href="https://web.archive.org/web/20240715203327cs_/https://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic&amp;subset=latin,cyrillic,greek,vietnamese" rel="stylesheet" type="text/css"> <link rel="canonical" href="https://web.archive.org/web/20240715203327/https://www.ruby-lang.org/en/documentation/faq/"> <link rel="shortcut icon" type="image/x-icon" href="/web/20240715203327im_/https://www.ruby-lang.org/favicon.ico"> <link href="/web/20240715203327/https://www.ruby-lang.org/en/feeds/news.rss" rel="alternate" title="Recent News (RSS)" type="application/rss+xml"> <script type="text/javascript" src="/web/20240715203327js_/https://www.ruby-lang.org/javascripts/jquery.min.js"></script> <script type="text/javascript" src="/web/20240715203327js_/https://www.ruby-lang.org/javascripts/page.js"></script> </head> <body> <div id="header"> <div id="header_content" class="container"> <a href="/web/20240715203327/https://www.ruby-lang.org/en/"> <h1>Ruby</h1> <h2>A Programmer's Best Friend</h2> </a> <div class="site-links"> <a href="/web/20240715203327/https://www.ruby-lang.org/en/" class="home">Home</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/downloads/">Downloads</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/documentation/">Documentation</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/libraries/">Libraries</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/community/">Community</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/news/">News</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/security/">Security</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/about/">About Ruby</a> <a href="#" class="menu selected">Menu</a> </div> <div id="search-box"> <form id="search-form" action="https://web.archive.org/web/20240715203327/https://www.google.com/cse"> <table class="fieldset"> <tr> <td> <input class="field" type="text" name="q" size="31" style="background: white url(//web.archive.org/web/20240715203327im_/https://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"> <div class="multi-page"> <strong>Content</strong> <span class="separator"> | </span> <a href="1/" title="Part 1">1</a> <span class="separator"> | </span> <a href="2/" title="Part 2">2</a> <span class="separator"> | </span> <a href="3/" title="Part 3">3</a> <span class="separator"> | </span> <a href="4/" title="Part 4">4</a> <span class="separator"> | </span> <a href="5/" title="Part 5">5</a> <span class="separator"> | </span> <a href="6/" title="Part 6">6</a> <span class="separator"> | </span> <a href="7/" title="Part 7">7</a> <span class="separator"> | </span> <a href="8/" title="Part 8">8</a> <span class="separator"> | </span> <a href="9/" title="Part 9">9</a> <span class="separator"> | </span> <a href="10/" title="Part 10">10</a> <span class="separator"> | </span> <a href="11/" title="Part 11">11</a> </div> <h1>Official Ruby FAQ</h1> <div id="content"> <p class="summary">This document contains Frequently Asked Questions about Ruby with answers.</p> <p>This FAQ is based on “<a href="https://web.archive.org/web/20240715203327/http://ruby-doc.org/docs/ruby-doc-bundle/FAQ/FAQ.html">The Ruby Language FAQ</a>” originally compiled by Shugo Maeda and translated into English by Kentaro Goto. Thanks to Zachary Scott and Marcus Stollsteimer for incorporating the FAQ into the site and for a major overhaul of the content.</p> <p>The code examples in this document have been run using Ruby 2.3.</p> <p><em>If you wish to report errors or suggest improvements for this FAQ, please go to our <a href="https://web.archive.org/web/20240715203327/https://github.com/ruby/www.ruby-lang.org/">GitHub repository</a> and open an issue or pull request.</em></p> <h2>Content</h2> <ul> <li><a href="1/">General questions</a></li> <li><a href="2/">How does Ruby stack up against…?</a></li> <li><a href="3/">Installing Ruby</a></li> <li><a href="4/">Variables, constants, and arguments</a></li> <li><a href="5/">Iterators</a></li> <li><a href="6/">Syntax</a></li> <li><a href="7/">Methods</a></li> <li><a href="8/">Classes and modules</a></li> <li><a href="9/">Built-in libraries</a></li> <li><a href="10/">Extension library</a></li> <li><a href="11/">Other features</a></li> </ul> </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://web.archive.org/web/20240715203327/https://try.ruby-lang.org/">Try Ruby! (in your browser)</a></li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/en/documentation/quickstart/">Ruby in Twenty Minutes</a></li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/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="/web/20240715203327/https://www.ruby-lang.org/en/documentation/">Documentation</a></li> <li><a href="https://web.archive.org/web/20240715203327/https://rubybib.org/">Academic Research</a></li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/en/libraries/">Libraries</a></li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/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="/web/20240715203327/https://www.ruby-lang.org/en/community/mailing-lists/">Mailing Lists</a>: Talk about Ruby with programmers from all around the world.</li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/en/community/user-groups/">User Groups</a>: Get in contact with Rubyists in your area.</li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/en/community/weblogs/">Blogs</a>: Read about what’s happening right now in the Ruby community.</li> <li><a href="/web/20240715203327/https://www.ruby-lang.org/en/community/ruby-core/">Ruby Core</a>: Help polish the rough edges of the latest Ruby.</li> <li><a href="https://web.archive.org/web/20240715203327/https://bugs.ruby-lang.org/">Issue Tracking</a>: Report or help solve issues in Ruby.</li> </ul> </div> <h3>Syndicate</h3> <p><a href="/web/20240715203327/https://www.ruby-lang.org/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="/web/20240715203327/https://www.ruby-lang.org/en/" class="home">Home</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/downloads/">Downloads</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/documentation/">Documentation</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/libraries/">Libraries</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/community/">Community</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/news/">News</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/security/">Security</a> <a href="/web/20240715203327/https://www.ruby-lang.org/en/about/">About Ruby</a> </div> <p> This site in other languages: <a href="/web/20240715203327/https://www.ruby-lang.org/bg/">Български</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/de/">Deutsch</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/en/">English</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/es/">Español</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/fr/">Français</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/id/">Bahasa Indonesia</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/it/">Italiano</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/ja/">日本語</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/ko/">한국어</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/pl/">polski</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/pt/">Português</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/ru/">Русский</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/tr/">Türkçe</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/vi/">Tiếng Việt</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/zh_cn/">简体中文</a>, <a href="/web/20240715203327/https://www.ruby-lang.org/zh_tw/">繁體中文</a>. </p> <p><a href="/web/20240715203327/https://www.ruby-lang.org/en/about/website/">This website</a> is proudly maintained by members of the Ruby community.</p> </div> </div> </body> </html> <!-- FILE ARCHIVED ON 20:33:27 Jul 15, 2024 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 21:43:05 Nov 30, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.545 exclusion.robots: 0.025 exclusion.robots.policy: 0.015 esindex: 0.011 cdx.remote: 43.828 LoadShardBlock: 341.876 (3) PetaboxLoader3.datanode: 200.081 (4) PetaboxLoader3.resolve: 159.716 (2) load_resource: 94.337 -->

Pages: 1 2 3 4 5 6 7 8 9 10