Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Ruby Programming
Previous Page Home Next Page

Environment Variables

You can access operating system environment variables using the predefined variable ENV. It responds to the same methods as Hash.[ENV is not actually a hash, but if you need to, you can convert it into a Hash using ENV#to_hash.]

The values of some environment variables are read by Ruby when it first starts. These variables modify the behavior of the interpreter, as shown in Table 13.1 on page 139.
Environment variables used by Ruby
Variable Name Description
RUBYOPT Additional command-line options to Ruby; examined after real command-line options are parsed ($SAFE must be 0).
RUBYLIB Additional search path for Ruby programs ($SAFE must be 0).
RUBYPATH With -S option, search path for Ruby programs (defaults to PATH).
RUBYSHELL Shell to use when spawning a process; if not set, will also check SHELL or COMSPEC.
DLN_LIBRARY_PATH Search path for dynamically loaded modules.
RUBYLIB_PREFIX (Windows only) Mangle the RUBYLIB search path by adding this prefix to each component.

Ruby Programming
Previous Page Home Next Page

  Published under the terms of the Open Publication License Design by Interspire