OS Manuals

/usr/bin/ri

the Ruby programming language

From ruby-4.0 4.0.9-r1 (os), captured 2026-11-05 by running ri --help (exit 0). permalink

Also provided by 4 other package versions
Usage: ri [options] [name ...]

Where name can be:

  Class | Module | Module::Class

  Class::method | Class#method | Class.method | method

  gem_name: | gem_name:README | gem_name:History

  ruby: | ruby:NEWS | ruby:globals

All class names may be abbreviated to their minimum unambiguous form.
If a name is ambiguous, all valid options will be listed.

A '.' matches either class or instance methods, while #method
matches only instance and ::method matches only class methods.

README and other files may be displayed by prefixing them with the gem name
they're contained in.  If the gem name is followed by a ':' all files in the
gem will be shown.  The file name extension may be omitted where it is
unambiguous.

'ruby' can be used as a pseudo gem name to display files from the Ruby
core documentation. Use 'ruby:' by itself to get a list of all available
core documentation files.

For example:

    ri Fil
    ri File
    ri File.new
    ri zip
    ri rdoc:README
    ri ruby:comments

Note that shell quoting or escaping may be required for method names
containing punctuation:

    ri 'Array.[]'
    ri compact\!

To see the default directories ri will search, run:

    ri --list-doc-dirs

Specifying the --system, --site, --home, --gems, or --doc-dir options
will limit ri to searching only the specified directories.

ri options may be set in the RI environment variable.

The ri pager can be set with the RI_PAGER environment variable
or the PAGER environment variable.

Options:

    -i, --[no-]interactive           In interactive mode you can repeatedly
                                     look up methods with autocomplete.

    -a, --[no-]all                   Show all documentation for a class or
                                     module.

    -l, --[no-]list                  List classes ri knows about.

        --[no-]pager                 Send output to a pager,
                                     rather than directly to stdout.

    -T                               Synonym for --no-pager.

    -w, --width=WIDTH                Set the width of the output.

        --server[=PORT]              Run RDoc server on the given port.
                                     The default port is 8214.

    -f, --format=NAME                Use the selected formatter.  The default
                                     formatter is bs for paged output and ansi
                                     otherwise.  Valid formatters are:
                                     ansi, bs, markdown, rdoc.

        --[no-]expand-refs           Expand rdoc-refs at the end of output

    -h, --help                       Show help and exit.

    -v, --version                    Output version information and exit.

Data source options:

        --[no-]list-doc-dirs         List the directories from which ri will
                                     source documentation on stdout and exit.

    -d, --doc-dir=DIRNAME            List of directories from which to source
                                     documentation in addition to the standard
                                     directories.  May be repeated.

        --no-standard-docs           Do not include documentation from
                                     the Ruby standard library, site_lib,
                                     installed gems, or ~/.rdoc.
                                     Use with --doc-dir.

        --[no-]system                Include documentation from Ruby's
                                     standard library.  Defaults to true.

        --[no-]site                  Include documentation from libraries
                                     installed in site_lib.
                                     Defaults to true.

        --[no-]gems                  Include documentation from RubyGems.
                                     Defaults to true.

        --[no-]home                  Include documentation stored in ~/.rdoc.
                                     Defaults to true.

Debug options:

        --[no-]profile               Run with the ruby profiler.

        --dump=CACHE                 Dump data from an ri cache or data file.
Options (12)
OptionDescriptionSource
-iIn interactive mode you can repeatedly look up methods with autocomplete.help
-aShow all documentation for a class or module.help
-lList classes ri knows about.help
-TSynonym for --no-pager.help
-w, --width WIDTHSet the width of the output.help
--server PORTRun RDoc server on the given port.help
-f, --format NAMEUse the selected formatter.help
-h, --helpShow help and exit.help
-v, --versionOutput version information and exit.help
-d, --doc-dir DIRNAMEList of directories from which to source documentation in addition to the standard directories.help
--no-standard-docsDo not include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc.help
--dump CACHEDump data from an ri cache or data file.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.