guides
Ruby Guides
Hand-picked places to learn Ruby.
For Beginners
New to Ruby — or to programming itself? Start here.
Ruby's Own Guides
Reference pages that ship with Ruby 4.0, with each example ready to run.
Ruby Syntax
An index of the language, from code layout to refinements.
ruby.help
Literals
How to write numbers, strings, symbols, arrays, hashes and ranges.
ruby.help
Control Expressions
if, unless, case, while, until and for. Each one returns a value.
ruby.help
Methods
How to define a method, with arguments, keyword arguments and blocks.
ruby.help
Pattern Matching
Match the shape of a value with case/in, and bind its parts to variables.
ruby.help
Exceptions
How to raise and rescue exceptions, and how to write your own.
ruby.help
Format Specifications
The format strings that sprintf, printf and String#% take.
ruby.help
Formats for Dates and Times
The directives that strftime takes for Time, Date and DateTime.
ruby.help
Encodings
How a string maps bytes to characters, and how to transcode it.
ruby.help
Implicit Conversions
to_str, to_ary and the other methods Ruby calls to convert an argument.
ruby.help
Pre-Defined Global Variables
What $0, $~, $stdout and the other global variables hold.
ruby.help