OS Manuals

/usr/bin/erb

the Ruby programming language

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

Also provided by 4 other package versions
Usage:
  erb [options] [filepaths]

Options:
  -d          --debug      Set $DEBUG to enable debugging.
  -E ex[:in]  --encoding ex[:in]
                           Set default external and internal encodings.
  -h          --help       Print this text and exit.
  -n                       Print generated Ruby source code with line numbers;
                           ignored if given without option -x.
  -P                       Disable execution tag shorthand (for lines beginning with '%').
  -r library               Load the named library.
  -T trim_mode             Specify trim_mode:
                           '0' means '%'; '1' means '%>'; '2' means '<>'; '-' means '%-'.
  -U                       Set default encoding to UTF-8.
  -v                       Set $VERBOSE to enable debugging,
              --version    Print ERB version string and exit.
  -x                       Print generated Ruby source code.
              --           Treat all following words as filepaths (not options).
  name=value               Set the variable named name to the given string value.

Filepaths:
  The erb program reads the text from all files at the filepaths as a single ERB template:
  plain text, possibly with embedded ERB tags;
  filepaths may be repeated.

  The pseudo-filepath '-' (hyphen character) specifies the standard input.

  If no filepaths are given, the sole input is the standard input.

See details and examples at https://docs.ruby-lang.org/en/master/erb_executable_md.html
Options (14)
OptionDescriptionSource
-d--debug Set $DEBUG to enable debugging.help + man
-E ex[:in--encoding ex[:in] Set default external and internal encodings.help
-h--help Print this text and exit.help + man
-nPrint generated Ruby source code with line numbers;help + man
-PDisable execution tag shorthand (for lines beginning with '%').help + man
-r libraryLoad the named library.help + man
-T trim_modeSpecify trim_mode: '0' means '%';help + man
-Ucan be one of Sets the default value for internal encodings ("Encoding.default_internal") to UTF-8.help + man
-vSet $VERBOSE to enable debugging,help + man
--versionPrint ERB version string and exit.help + man
-xConverts the eRuby script into Ruby script and prints it without line numbers.help + man
-S levelSpecifies the safe level in which eRuby script will run. (in the manual page but not in --help)man
--debugTurns on debug mode. (in the manual page but not in --help)man
--helpPrints a summary of the options. (in the manual page but not in --help)man
Examples (1) from the manual page, untested

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