Ruby Environment Variables

The Ruby interpreter uses the following environment variables to control its behavior. The ENV object contains a list of all currently set environment variables.

VariableDescription
DLN_LIBRARY_PATHThe search path for dynamically loaded modules.
HOMEThe directory to move to when no argument is passed to Dir::chdir. Also used by File::expand_path to expand "~".
LOGDIRThe directory to move to when no argument is passed to Dir::chdir and the HOME environment variable is not set.
PATHThe search path for executing child processes, and the search path for Ruby programs after the -S option is specified. Each path is separated by a colon (separated by a semicolon in DOS and Windows).
RUBYLIBThe search path for libraries. Each path is separated by a colon (separated by a semicolon in DOS and Windows).
RUBYLIB_PREFIXUsed to modify the RUBYLIB search path, by using the format path1;path2 or path1path2, to replace the library prefix path1 with path2.
RUBYOPTCommand line options passed to the Ruby interpreter. Ignored in taint mode (where $SAFE is greater than 0).
RUBYPATHThe search path for Ruby programs after the -S option is specified. Takes priority over PATH. Ignored in taint mode (where $SAFE is greater than 0).
RUBYSHELLSpecifies the shell used when executing commands. If this environment variable is not set, SHELL or COMSPEC is used.

For Unix, useenvcommand to view the list of all environment variables.

HOSTNAME=ip-72-167-112-17.ip.secureserver.net
RUBYPATH=/usr/bin
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
SSH_CLIENT=122.169.131.179 1742 22
SSH_TTY=/dev/pts/1
USER=amrood
JRE_HOME=/usr/java/jdk/jre
J2RE_HOME=/usr/java/jdk/jre
PATH=/usr/local/bin:/bin:/usr/bin:/home/guest/bin
MAIL=/var/spool/mail/guest
PWD=/home/amrood
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/java/jdk
LANG=C
HOME=/root
SHLVL=2
JDK_HOME=/usr/java/jdk
LOGDIR=/usr/log/ruby
LOGNAME=amrood
SSH_CONNECTION=122.169.131.179 1742 72.167.112.17 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
RUBYLIB=/usr/lib/ruby
G_BROKEN_FILENAMES=1
_=/bin/env
Other Extensions