Ruby Basic environment variable settings and common interpreter commands Introduction to _ruby topics

Source: Internet
Author: User

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

For Unix, use the ENV command to view a 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
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
lessopen=|/usr/bin/lesspipe.sh%s
rubylib=/usr/lib/ Ruby
G_broken_filenames=1
_=/bin/env

Ruby Command line Options
Ruby is typically run from the command line as follows:

$ ruby [Options] [.] [Programfile] [Arguments ...]


The interpreter can be invoked with the following options to control the environment and behavior of the interpreter.

Given command-line options can be used in combination. The following two lines express the same meaning:

$ Ruby-ne ' Print if/ruby/'/usr/share/bin


$ ruby-n-E ' Print if/ruby/'/usr/share/bin

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.