Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, February 9, 2022

ri (1)


ri - Ruby API reference front end


ri  [-ahilTv]  [-d  DIRNAME]  [-f  FORMAT]  [-w  WIDTH]  [--[no-]pager]
[--server[=PORT]]      [--[no-]list-doc-dirs]      [--no-standard-docs]
[--[no-]{system|site|gems|home}]  [--[no-]profile] [--dump=CACHE] [name


RI(1)                                UNIX                                RI(1)

       ri - Ruby API reference front end

       ri  [-ahilTv]  [-d  DIRNAME]  [-f  FORMAT]  [-w  WIDTH]  [--[no-]pager]
       [--server[=PORT]]      [--[no-]list-doc-dirs]      [--no-standard-docs]
       [--[no-]{system|site|gems|home}]  [--[no-]profile] [--dump=CACHE] [name

       ri is a command-line front end for the Ruby  API  reference.   You  can
       search and read the API reference for classes and methods with .

       ri is a part of Ruby.

       name can be: It Class | Module | Module::Class

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

       It gem_name: | gem_name:README | gem_name:History

       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.

       For example:

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

       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.


              In  interactive  mode  you  can  repeatedly look up methods with


              Show all documentation for a class or module.


              List classes ri knows about.

              Send output to a pager, rather than directly to stdout.

       -T     Synonym for --no-pager.

       -w WIDTH

              Set the width of the output.

              Run RDoc server on the given port.  The default port is 8214.

       -f FORMAT

              Use the selected formatter.  The default  formatter  is  bs  for
              paged   output   and  ansi  otherwise.   Valid  formatters  are:


       --help Show help and exit.


              Output version information and exit.

              Data source options:

              List the directories from which ri will source documentation  on
              stdout and exit.

       -d DIRNAME

              List  of directories from which to source documentation in addi-
              tion to the standard directories.  May be repeated.

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

              Include documentation from Ruby's standard library.  Defaults to

              Include documentation  from  libraries  installed  in  site_lib.
              Defaults to true.

              Include documentation from RubyGems.  Defaults to true.

              Include documentation stored in ~/.rdoc.  Defaults to true.

              Debug options:

              Run with the Ruby profiler.

              Dump data from an ri cache or data file.

       RI     Options to prepend to those specified on the command-line.


       PAGER  Pager program to use for displaying.



              Path to the user's home directory.

              Path for ri data in the user's home directory.

       See attributes(7) for descriptions of the following attributes:

       |Availability   | runtime/ruby-26  |
       |Stability      | Uncommitted      |

       ruby(1), rdoc(1), gem(1)

       o      Security  vulnerabilities  should be reported via an email to Mt
              security@ruby-lang.org.  Reported  problems  will  be  published
              after being fixed.

       o      Other  bugs  and  feature  requests can be reported via the Ruby
              Issue Tracking  System  (https://bugs.ruby-lang.org/).   Do  not
              report  security vulnerabilities via this system because it pub-
              lishes the vulnerabilities immediately.

       Written by Dave Thomas <dave@pragmaticprogrammer.com>.

       Source code for open source software components in Oracle  Solaris  can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-

       This    software    was    built    from    source     available     at
       https://github.com/oracle/solaris-userland.    The  original  community
       source       was       downloaded       from         http://cache.ruby-

       Further information about this software can be found on the open source
       community website at http://www.ruby-lang.org/.

April 20, 2017                               Ruby Programmer's Reference Guide