Environment Variables
In addition to
using arguments and options on the command line, the Ruby interpreter
uses the following environment variables to control its behavior. The
ENV object contains a list of current environment
variables.
DLN_LIBRARY_PATHSearch path for dynamically loaded modules.
HOMEDirectory moved to when no argument is passed to
Dir::chdir. Also used byFile::expand_pathto expand “~”.LOGDIRDirectory moved to when no arguments are passed to
Dir::chdirand environment variableHOMEisn’t set.PATHSearch path for executing subprocesses and searching for Ruby programs with the
-Soption. Separate each path with a colon (semicolon in DOS and Windows).RUBYLIBSearch path for libraries. Separate each path with a colon (semicolon in DOS and Windows).
RUBYLIB_PREFIXUsed to modify the RUBYLIB search path by replacing prefix of library
path1withpath2using the formatpath1;path2orpath1path2. For example, ifRUBYLIBis:/usr/local/lib/ruby/site_ruby
and
RUBYLIB_PREFIXis:/usr/local/lib/ruby;f:/ruby
Ruby searches
f:/ruby/site_ruby. Works only with DOS, Windows, and OS/2 versions.RUBYOPTCommand-line options passed to Ruby interpreter. Ignored in taint mode (where
$SAFEis greater than 0).RUBYPATHWith
-Soption, search path for Ruby programs. Takes precedence overPATH. Ignored in taint mode (where$SAFEis greater than 0).RUBYSHELLSpecifies shell for spawned processes. If not set,
SHELLorCOMSPECare checked.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access