English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Ruby interpreter uses the following environment variables to control its behavior. The ENV object contains a list of all currently set environment variables.
Variable | Description |
---|---|
DLN_LIBRARY_PATH | The path for dynamically loading modules. |
HOME | The directory to move to when no parameters are passed to Dir::chdir. It is also used by File::expand_path to expand "~". |
LOGDIR | The directory to move to when no parameters are passed to Dir::chdir and the environment variable HOME is not set. |
PATH | The search path for executing subprocesses, as well as the path to move to when specifying -The S option after Ruby program's search path. Each path is separated by a colon (in DOS and Windows, it is separated by a semicolon). |
RUBYLIB | The library search path. Each path is separated by a colon (in DOS and Windows, it is separated by a semicolon). |
RUBYLIB_PREFIX | Used to modify the RUBYLIB search path, using the format path1;path2 or path1path2, prefix the library path with path1 Replace with path2. |
RUBYOPT | Command-line options passed to the Ruby interpreter. It is ignored in taint mode (where $SAFE is greater than 0). |
RUBYPATH | Specify -The S option after Ruby program's search path. Has a higher priority than PATH. It is ignored in taint mode (where $SAFE is greater than 0). |
RUBYSHELL | to specify the shell to be used when executing a command. If this environment variable is not set, SHELL or COMSPEC will be used. |
For Unix, use env Use the command 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