{
    "mode": "man",
    "parameter": "ruby",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ruby/1/json",
    "generated": "2026-10-21T06:08:09Z",
    "synopsis": "ruby     [--copyright]     [--version]    [-SUacdlnpswvy]    [-0[octal]]    [-C    directory]\n[-E external[:internal]] [-F[pattern]] [-I directory]  [-K[c]]  [-T[level]]  [-W[level]]\n[-e  command]  [-i[extension]] [-r library] [-x[directory]] [--{enable|disable}-FEATURE]\n[--dump=target] [--verbose] [--] [programfile] [argument ...]",
    "sections": {
        "NAME": {
            "content": "ruby — Interpreted object-oriented scripting language\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ruby     [--copyright]     [--version]    [-SUacdlnpswvy]    [-0[octal]]    [-C    directory]\n[-E external[:internal]] [-F[pattern]] [-I directory]  [-K[c]]  [-T[level]]  [-W[level]]\n[-e  command]  [-i[extension]] [-r library] [-x[directory]] [--{enable|disable}-FEATURE]\n[--dump=target] [--verbose] [--] [programfile] [argument ...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Ruby is an interpreted scripting language for quick and easy object-oriented programming.  It\nhas many features to process text files and to do system management tasks (like in Perl).  It\nis simple, straight-forward, and extensible.\n\nIf you want a language for easy object-oriented programming, or you don't like the Perl ugli‐\nness, or you do like the concept of LISP, but don't like too many parentheses, Ruby might  be\nyour language of choice.\n",
            "subsections": []
        },
        "FEATURES": {
            "content": "Ruby's features are as follows:\n",
            "subsections": [
                {
                    "name": "Interpretive",
                    "content": "Ruby  is  an interpreted language, so you don't have to recompile programs written in\nRuby to execute them.\n"
                },
                {
                    "name": "Variables have no type (dynamic typing)",
                    "content": "Variables in Ruby can contain data of any type.  You don't have to worry about  vari‐\nable typing.  Consequently, it has a weaker compile time check.\n"
                },
                {
                    "name": "No declaration needed",
                    "content": "You can use variables in your Ruby programs without any declarations.  Variable names\ndenote their scope - global, class, instance, or local.\n"
                },
                {
                    "name": "Simple syntax",
                    "content": "Ruby has a simple syntax influenced slightly from Eiffel.\n"
                },
                {
                    "name": "No user-level memory management",
                    "content": "Ruby has automatic memory management.  Objects no longer referenced from anywhere are\nautomatically collected by the garbage collector built into the interpreter.\n"
                },
                {
                    "name": "Everything is an object",
                    "content": "Ruby  is a purely object-oriented language, and was so since its creation.  Even such\nbasic data as integers are seen as objects.\n"
                },
                {
                    "name": "Class, inheritance, and methods",
                    "content": "Being an object-oriented language, Ruby naturally has basic  features  like  classes,\ninheritance, and methods.\n"
                },
                {
                    "name": "Singleton methods",
                    "content": "Ruby has the ability to define methods for certain objects.  For example, you can de‐\nfine  a press-button action for certain widget by defining a singleton method for the\nbutton.  Or, you can make up your own prototype based object system  using  singleton\nmethods, if you want to.\n"
                },
                {
                    "name": "Mix-in by modules",
                    "content": "Ruby intentionally does not have the multiple inheritance as it is a source of confu‐\nsion.   Instead, Ruby has the ability to share implementations across the inheritance\ntree.  This is often called a ‘Mix-in’.\n"
                },
                {
                    "name": "Iterators",
                    "content": "Ruby has iterators for loop abstraction.\n"
                },
                {
                    "name": "Closures",
                    "content": "In Ruby, you can objectify the procedure.\n"
                },
                {
                    "name": "Text processing and regular expressions",
                    "content": "Ruby has a bunch of text processing features like in Perl.\n"
                },
                {
                    "name": "M17N, character set independent",
                    "content": "Ruby supports multilingualized programming. Easy to process  texts  written  in  many\ndifferent  natural languages and encoded in many different character encodings, with‐\nout dependence on Unicode.\n"
                },
                {
                    "name": "Bignums",
                    "content": "With built-in bignums, you can for example calculate factorial(400).\n"
                },
                {
                    "name": "Reflection and domain specific languages",
                    "content": "Class is also an instance of the Class class. Definition of classes and methods is an\nexpression just as 1+1 is. So your programs can even write and modify programs.  Thus\nyou can write your application in your own programming language on top of Ruby.\n"
                },
                {
                    "name": "Exception handling",
                    "content": "As in Java(tm).\n"
                },
                {
                    "name": "Direct access to the OS",
                    "content": "Ruby can use most Unix system calls, often used in system programming.\n"
                },
                {
                    "name": "Dynamic loading",
                    "content": "On most Unix systems, you can load object files into the Ruby interpreter on-the-fly.\n"
                },
                {
                    "name": "Rich libraries",
                    "content": "In addition to the “builtin libraries” and “standard libraries” that are bundled with\nRuby, a vast amount of third-party libraries (“gems”) are available via  the  package\nmanagement  system  called ‘RubyGems’, namely the gem(1) command.  Visit RubyGems.org\n(https://rubygems.org/)  to  find   the   gems   you   need,   and   explore   GitHub\n(https://github.com/) to see how they are being developed and used.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "The  Ruby  interpreter accepts the following command-line options (switches).  They are quite\nsimilar to those of perl(1).\n\n--copyright    Prints the copyright notice, and quits immediately without running any script.\n\n--version      Prints the version of the Ruby interpreter, and quits immediately without run‐\nning any script.\n",
            "subsections": [
                {
                    "name": "-0",
                    "content": "number.  If  no  digit is given, the null character is taken as the separator.\nOther switches may follow the digits.  -00 turns  Ruby  into  paragraph  mode.\n-0777  makes Ruby read whole file at once as a single string since there is no\nlegal character with that value.\n",
                    "flag": "-0"
                },
                {
                    "name": "-C _",
                    "content": "",
                    "flag": "-C"
                },
                {
                    "name": "-X _",
                    "content": "",
                    "flag": "-X"
                },
                {
                    "name": "-E _",
                    "content": "--encoding external[:internal]\nSpecifies the default value(s) for external encodings and  internal  encoding.\nValues should be separated with colon (:).\n\nYou   can   omit   the   one   for   internal   encodings,   then   the  value\n(Encoding.defaultinternal) will be nil.\n\n--external-encoding=encoding\n--internal-encoding=encoding\nSpecify the default external or internal character encoding\n",
                    "flag": "-E"
                },
                {
                    "name": "-F _",
                    "content": "",
                    "flag": "-F"
                },
                {
                    "name": "-I _",
                    "content": "added to the load-path variable ($:).\n",
                    "flag": "-I"
                },
                {
                    "name": "-K _",
                    "content": "(ENCODING) and external encodings (Encoding.defaultexternal) will be  the\nspecified one. kcode can be one of\n\ne       EUC-JP\n\ns       Windows-31J (CP932)\n\nu       UTF-8\n\nn       ASCII-8BIT (BINARY)\n",
                    "flag": "-K"
                },
                {
                    "name": "-S",
                    "content": "name begins with a slash.  This is used to emulate #! on machines  that  don't\nsupport it, in the following manner:\n\n#! /usr/local/bin/ruby\n# This line makes the next one a comment in Ruby \\\nexec /usr/local/bin/ruby -S $0 $*\n\nOn  some systems $0 does not always contain the full pathname, so you need the\n-S switch to tell Ruby to search for the script if necessary (to handle embed‐\nded spaces and such).  A better construct than $* would be ${1+\"$@\"},  but  it\ndoes not work if the script is being interpreted by csh(1).\n",
                    "flag": "-S"
                },
                {
                    "name": "-T",
                    "content": "",
                    "flag": "-T"
                },
                {
                    "name": "-U",
                    "content": "UTF-8.\n",
                    "flag": "-U"
                },
                {
                    "name": "-W",
                    "content": "sage at the beginning. The level can be;\n\n0       Verbose mode is \"silence\". It sets the $VERBOSE to nil.\n\n1       Verbose mode is \"medium\". It sets the $VERBOSE to false.\n\n2 (default) Verbose mode is \"verbose\". It sets  the  $VERBOSE  to  true.\n-W2 is the same as -w\n",
                    "flag": "-W"
                },
                {
                    "name": "-a              -n  -p",
                    "content": "executes\n$F = $.split\nat beginning of each loop.\n",
                    "flag": "-p"
                },
                {
                    "name": "-c",
                    "content": "there  are  no syntax errors, Ruby will print “Syntax OK” to the standard out‐\nput.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "--debug        Turns on debug mode.  $DEBUG will be set to true.\n",
                    "flag": "-d"
                },
                {
                    "name": "-e _",
                    "content": "of the arguments for a script file name.\n",
                    "flag": "-e"
                },
                {
                    "name": "-h",
                    "content": "--help         Prints a summary of the options.\n",
                    "flag": "-h"
                },
                {
                    "name": "-i _",
                    "content": "file name to make a backup copy.  For example:\n\n% echo matz > /tmp/junk\n% cat /tmp/junk\nmatz\n% ruby -p -i.bak -e '$.upcase!' /tmp/junk\n% cat /tmp/junk\nMATZ\n% cat /tmp/junk.bak\nmatz\n",
                    "flag": "-i"
                },
                {
                    "name": "-l",
                    "content": "means to firstly set $\\ to the value of $/, and secondly chops every line read\nusing chomp!.\n",
                    "flag": "-l"
                },
                {
                    "name": "-n",
                    "content": "iterate over file name arguments somewhat like sed -n or awk.\n\nwhile gets\n...\nend\n",
                    "flag": "-n"
                },
                {
                    "name": "-p",
                    "content": "end of the loop.  For example:\n\n% echo matz | ruby -p -e '$.tr! \"a-z\", \"A-Z\"'\nMATZ\n",
                    "flag": "-p"
                },
                {
                    "name": "-r _ -n",
                    "content": "-p.\n",
                    "flag": "-n"
                },
                {
                    "name": "-s",
                    "content": "name  arguments  (or  before a --).  Any switches found there are removed from\nARGV and set the corresponding variable in the script.  For example:\n\n#! /usr/local/bin/ruby -s\n# prints \"true\" if invoked with `-xyz' switch.\nprint \"true\\n\" if $xyz\n",
                    "flag": "-s"
                },
                {
                    "name": "-v",
                    "content": "the  variable  $VERBOSE  to  true.   Some methods print extra messages if this\nvariable is true.  If this switch is given, and no other switches are present,\nRuby quits after printing its version.\n",
                    "flag": "-v"
                },
                {
                    "name": "-w",
                    "content": "sets the $VERBOSE variable to true.\n",
                    "flag": "-w"
                },
                {
                    "name": "-x",
                    "content": "discarded until the first line that starts with “#!” and contains the  string,\n“ruby”.  Any meaningful switches on that line will be applied.  The end of the\nscript  must  be specified with either EOF, ^D (control-D), ^Z (control-Z), or\nthe reserved word END.  If the directory  name  is  specified,  Ruby  will\nswitch to that directory before executing script.\n",
                    "flag": "-x"
                },
                {
                    "name": "-y",
                    "content": "--yydebug      DO NOT USE.\n\nTurns  on compiler debug mode.  Ruby will print a bunch of internal state mes‐\nsages during compilation.  Only specify this switch you are going to debug the\nRuby interpreter.\n\n--disable-FEATURE\n--enable-FEATURE\nDisables (or enables) the specified FEATURE.\n--disable-gems\n--enable-gems      Disables (or enables) RubyGems libraries.  By default, Ruby\nwill load the latest version of each installed gem. The Gem\nconstant is true if RubyGems is enabled,  false  if  other‐\nwise.\n\n--disable-rubyopt\n--enable-rubyopt   Ignores (or considers) the RUBYOPT environment variable. By\ndefault, Ruby considers the variable.\n\n--disable-all\n--enable-all       Disables (or enables) all features.\n\n--dump=target  Dump some information.\n\nPrints the specified target.  target can be one of:\n\nversion Print version description (same as --version).\n\nusage   Print a brief usage message (same as -h).\n\nhelp    Show long help message (same as --help).\n\nsyntax  Check syntax (same as -c --yydebug).\n\nOr one of the following, which are intended for debugging the interpreter:\n\nyydebug                 Enable compiler debug mode (same as --yydebug).\n\nparsetree               Print  a  textual representation of the Ruby AST\nfor the program.\n\nparsetreewithcomment  Print a textual representation of the  Ruby  AST\nfor the program, but with each node annoted with\nthe associated Ruby source code.\n\ninsns                   Print  a  list of disassembled bytecode instruc‐\ntions.\n\ninsnswithoutopt       Print the list of disassembled bytecode instruc‐\ntions before various optimizations have been ap‐\nplied.\n\n--verbose      Enables verbose mode without printing version message at  the  beginning.   It\nsets  the  $VERBOSE  variable to true.  If this switch is given, and no script\narguments (script file or -e options) are present, Ruby quits immediately.\n",
                    "flag": "-y"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "RUBYLIB    A colon-separated list of directories that are added to Ruby's library  load  path\n($:).  Directories from this environment variable are searched before the standard\nload path is searched.\n\ne.g.:\nRUBYLIB=\"$HOME/lib/ruby:$HOME/lib/rubyext\"\n\nRUBYOPT    Additional Ruby options.\n\ne.g.\nRUBYOPT=\"-w -Ke\"\n\nNote that RUBYOPT can contain only -d, -E,  -I,  -K,  -r,  -T,  -U,  -v,  -w,  -W,\n--debug, --disable-FEATURE and --enable-FEATURE.\n\nRUBYPATH   A  colon-separated  list  of directories that Ruby searches for Ruby programs when\nthe -S flag is specified.  This variable precedes the PATH environment variable.\n\nRUBYSHELL  The path to the system shell command.  This environment variable  is  enabled  for\nonly  mswin32, mingw32, and OS/2 platforms.  If this variable is not defined, Ruby\nrefers to COMSPEC.\n\nPATH       Ruby refers to the PATH environment variable on calling Kernel#system.\n\nAnd Ruby depends on some RubyGems related environment variables unless RubyGems is  disabled.\nSee the help of gem(1) as below.\n\n% gem help\n",
            "subsections": []
        },
        "GC ENVIRONMENT": {
            "content": "The Ruby garbage collector (GC) tracks objects in fixed-sized slots, but each object may have\nauxiliary  memory  allocations  handled  by  the  malloc family of C standard library calls (\nmalloc(3), calloc(3), and realloc(3)).  In this documentatation, the  \"heap\"  refers  to  the\nRuby  object  heap  of fixed-sized slots, while \"malloc\" refers to auxiliary allocations com‐\nmonly referred to as the \"process heap\".  Thus there are at least two possible ways to  trig‐\nger GC:\n\n1       Reaching the object limit.\n\n2       Reaching the malloc limit.\n\nIn Ruby 2.1, the generational GC was introduced and the limits are divided into young and old\ngenerations, providing two additional ways to trigger a GC:\n\n3       Reaching the old object limit.\n\n4       Reaching the old malloc limit.\n\nThere  are  currently 4 possible areas where the GC may be tuned by the following 11 environ‐\nment variables:\nRUBYGCHEAPINITSLOTS                Initial allocation slots.  Introduced in Ruby 2.1, de‐\nfault: 10000.\n\nRUBYGCHEAPFREESLOTS                Prepare at least this amount of slots after GC.  Allo‐\ncate this number slots if there are not enough  slots.\nIntroduced in Ruby 2.1, default: 4096\n\nRUBYGCHEAPGROWTHFACTOR             Increase allocation rate of heap slots by this factor.\nIntroduced in Ruby 2.1, default: 1.8, minimum: 1.0 (no\ngrowth)\n\nRUBYGCHEAPGROWTHMAXSLOTS          Allocation  rate  is  limited to this number of slots,\npreventing     excessive     allocation     due     to\nRUBYGCHEAPGROWTHFACTOR.   Introduced  in Ruby 2.1,\ndefault: 0 (no limit)\n\nRUBYGCHEAPOLDOBJECTLIMITFACTOR    Perform a full GC when the number of  old  objects  is\nmore  than  R * N, where R is this factor and N is the\nnumber of old objects after the last full GC.   Intro‐\nduced in Ruby 2.1.1, default: 2.0\n\nRUBYGCMALLOCLIMIT                   The  initial limit of young generation allocation from\nthe malloc-family.  GC will start when this  limit  is\nreached.  Default: 16MB\n\nRUBYGCMALLOCLIMITMAX               The  maximum limit of young generation allocation from\nmalloc before GC starts.   Prevents  excessive  malloc\ngrowth due to RUBYGCMALLOCLIMITGROWTHFACTOR.  In‐\ntroduced in Ruby 2.1, default: 32MB.\n\nRUBYGCMALLOCLIMITGROWTHFACTOR     Increases  the limit of young generation malloc calls,\nreducing GC frequency but increasing malloc growth un‐\ntil RUBYGCMALLOCLIMITMAX is  reached.   Introduced\nin Ruby 2.1, default: 1.4, minimum: 1.0 (no growth)\n\nRUBYGCOLDMALLOCLIMIT                The  initial  limit  of old generation allocation from\nmalloc, a full  GC  will  start  when  this  limit  is\nreached.  Introduced in Ruby 2.1, default: 16MB\n\nRUBYGCOLDMALLOCLIMITMAX            The  maximum  limit  of old generation allocation from\nmalloc before a full GC  starts.   Prevents  excessive\nmalloc      growth      due     to     RUBYGCOLDMAL‐\nLOCLIMITGROWTHFACTOR.  Introduced in Ruby 2.1,  de‐\nfault: 128MB\n\nRUBYGCOLDMALLOCLIMITGROWTHFACTOR  Increases  the  limit of old generation malloc alloca‐\ntion, reducing full GC frequency but increasing malloc\ngrowth until RUBYGCOLDMALLOCLIMITMAX  is  reached.\nIntroduced in Ruby 2.1, default: 1.2, minimum: 1.0 (no\ngrowth)\n",
            "subsections": []
        },
        "STACK SIZE ENVIRONMENT": {
            "content": "Stack size environment variables are implementation-dependent and subject to change with dif‐\nferent  versions of Ruby.  The VM stack is used for pure-Ruby code and managed by the virtual\nmachine.  Machine stack is used by the operating system and its usage is dependent on  C  ex‐\ntensions  as well as C compiler options.  Using lower values for these may allow applications\nto keep more Fibers or Threads running; but increases the chance of  SystemStackError  excep‐\ntions  and  segmentation  faults  (SIGSEGV).  These environment variables are available since\nRuby 2.0.0.  All values are specified in bytes.\n\nRUBYTHREADVMSTACKSIZE       VM stack size  used  at  thread  creation.   default:  524288\n(32-bit CPU) or 1048575 (64-bit)\n\nRUBYTHREADMACHINESTACKSIZE  Machine  stack size used at thread creation.  default: 524288\nor 1048575\n\nRUBYFIBERVMSTACKSIZE        VM stack size used at  fiber  creation.   default:  65536  or\n131072\n\nRUBYFIBERMACHINESTACKSIZE   Machine  stack  size used at fiber creation.  default: 262144\nor 524288\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "https://www.ruby-lang.org/     The official web site.\nhttps://www.ruby-toolbox.com/  Comprehensive catalog of Ruby libraries.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "•   Security vulnerabilities should be reported via an email to security@ruby-lang.org.   Re‐\nported problems will be published after being fixed.\n\n•   Other  bugs  and  feature  requests  can  be  reported via the Ruby Issue Tracking System\n(https://bugs.ruby-lang.org/).  Do not report security vulnerabilities  via  this  system\nbecause it publishes the vulnerabilities immediately.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Ruby is designed and implemented by Yukihiro Matsumoto <matz@netlab.jp>.\n\nSee ⟨https://bugs.ruby-lang.org/projects/ruby/wiki/Contributors⟩ for contributors to Ruby.\n\nUNIX                                       April 14, 2018                                    RUBY(1)",
            "subsections": []
        }
    },
    "summary": "ruby — Interpreted object-oriented scripting language",
    "flags": [
        {
            "flag": "-0",
            "long": null,
            "arg": null,
            "description": "number. If no digit is given, the null character is taken as the separator. Other switches may follow the digits. -00 turns Ruby into paragraph mode. -0777 makes Ruby read whole file at once as a single string since there is no legal character with that value."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "--encoding external[:internal] Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:). You can omit the one for internal encodings, then the value (Encoding.defaultinternal) will be nil. --external-encoding=encoding --internal-encoding=encoding Specify the default external or internal character encoding"
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": "added to the load-path variable ($:)."
        },
        {
            "flag": "-K",
            "long": null,
            "arg": null,
            "description": "(ENCODING) and external encodings (Encoding.defaultexternal) will be the specified one. kcode can be one of e EUC-JP s Windows-31J (CP932) u UTF-8 n ASCII-8BIT (BINARY)"
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "name begins with a slash. This is used to emulate #! on machines that don't support it, in the following manner: #! /usr/local/bin/ruby # This line makes the next one a comment in Ruby \\ exec /usr/local/bin/ruby -S $0 $* On some systems $0 does not always contain the full pathname, so you need the -S switch to tell Ruby to search for the script if necessary (to handle embed‐ ded spaces and such). A better construct than $* would be ${1+\"$@\"}, but it does not work if the script is being interpreted by csh(1)."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "UTF-8."
        },
        {
            "flag": "-W",
            "long": null,
            "arg": null,
            "description": "sage at the beginning. The level can be; 0 Verbose mode is \"silence\". It sets the $VERBOSE to nil. 1 Verbose mode is \"medium\". It sets the $VERBOSE to false. 2 (default) Verbose mode is \"verbose\". It sets the $VERBOSE to true. -W2 is the same as -w"
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "executes $F = $.split at beginning of each loop."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "there are no syntax errors, Ruby will print “Syntax OK” to the standard out‐ put."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "--debug Turns on debug mode. $DEBUG will be set to true."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "of the arguments for a script file name."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "--help Prints a summary of the options."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "file name to make a backup copy. For example: % echo matz > /tmp/junk % cat /tmp/junk matz % ruby -p -i.bak -e '$.upcase!' /tmp/junk % cat /tmp/junk MATZ % cat /tmp/junk.bak matz"
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "means to firstly set $\\ to the value of $/, and secondly chops every line read using chomp!."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "iterate over file name arguments somewhat like sed -n or awk. while gets ... end"
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "end of the loop. For example: % echo matz | ruby -p -e '$.tr! \"a-z\", \"A-Z\"' MATZ"
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "-p."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "name arguments (or before a --). Any switches found there are removed from ARGV and set the corresponding variable in the script. For example: #! /usr/local/bin/ruby -s # prints \"true\" if invoked with `-xyz' switch. print \"true\\n\" if $xyz"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "the variable $VERBOSE to true. Some methods print extra messages if this variable is true. If this switch is given, and no other switches are present, Ruby quits after printing its version."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "sets the $VERBOSE variable to true."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "discarded until the first line that starts with “#!” and contains the string, “ruby”. Any meaningful switches on that line will be applied. The end of the script must be specified with either EOF, ^D (control-D), ^Z (control-Z), or the reserved word END. If the directory name is specified, Ruby will switch to that directory before executing script."
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "--yydebug DO NOT USE. Turns on compiler debug mode. Ruby will print a bunch of internal state mes‐ sages during compilation. Only specify this switch you are going to debug the Ruby interpreter. --disable-FEATURE --enable-FEATURE Disables (or enables) the specified FEATURE. --disable-gems --enable-gems Disables (or enables) RubyGems libraries. By default, Ruby will load the latest version of each installed gem. The Gem constant is true if RubyGems is enabled, false if other‐ wise. --disable-rubyopt --enable-rubyopt Ignores (or considers) the RUBYOPT environment variable. By default, Ruby considers the variable. --disable-all --enable-all Disables (or enables) all features. --dump=target Dump some information. Prints the specified target. target can be one of: version Print version description (same as --version). usage Print a brief usage message (same as -h). help Show long help message (same as --help). syntax Check syntax (same as -c --yydebug). Or one of the following, which are intended for debugging the interpreter: yydebug Enable compiler debug mode (same as --yydebug). parsetree Print a textual representation of the Ruby AST for the program. parsetreewithcomment Print a textual representation of the Ruby AST for the program, but with each node annoted with the associated Ruby source code. insns Print a list of disassembled bytecode instruc‐ tions. insnswithoutopt Print the list of disassembled bytecode instruc‐ tions before various optimizations have been ap‐ plied. --verbose Enables verbose mode without printing version message at the beginning. It sets the $VERBOSE variable to true. If this switch is given, and no script arguments (script file or -e options) are present, Ruby quits immediately."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Ruby programming language interpreter.",
        "examples": [
            {
                "description": "Execute a Ruby script",
                "command": "ruby {{path/to/script.rb}}"
            },
            {
                "description": "Execute a single Ruby command in the command-line",
                "command": "ruby -e \"{{command}}\""
            },
            {
                "description": "Check for syntax errors on a given Ruby script",
                "command": "ruby -c {{path/to/script.rb}}"
            },
            {
                "description": "Start the built-in HTTP server on port 8080 in the current directory",
                "command": "ruby -run -e httpd"
            },
            {
                "description": "Locally execute a Ruby binary without installing the required library it depends on",
                "command": "ruby -I {{path/to/library_folder}} -r {{library_require_name}} {{path/to/bin_folder/bin_name}}"
            },
            {
                "description": "Display version",
                "command": "ruby {{-v|--version}}"
            }
        ]
    }
}