Ruby installation and Operation _ruby Topics

Source: Internet
Author: User
Tags version control system

Installation of Ruby

Pay attention.

    1. OS X or Linux is better
    2. Implementation of different versions: C + +, C, Java
    3. This time C Ruby

Installation method

    1. Linux or OS X has pre-installed
    2. Package Manager (APT, yum, Brew), not the latest
    3. Version control system: RVM (Rvm.io), rbenv

Rvm

    1. View Ruby version
RVM list known

Installation

RVM Install 2.2.1

Help

RVM--help
User manual: Man RVM

Rbenv

    1. Install with brew under OS X

Windows install via Rubyinstaller

Learning materials

Tools

Deploy platform Linux under

Common installation Method: source code compilation, step

    1. Download and unzip the website
    2. ./config
    3. Make
    4. Make install to the path
    5. Ruby-v View Version

Ruby's Run

Two ways:

Interactive:

1. Use Ruby command: Ruby
2.irb:irb

Writing Program Files (. RB)

1. Save the program in a file and use the ruby command to

Vim hello.rb

puts "Hello world"

def Hello (name)
 puts "Hello #{name}"
End

Hello (' mac ')

Ruby Hello.rb

Ruby's Document System

RDOC: Document Generation Tool
Ri: Reading RDOC documents

RI Mina

ri--serve Browser Browse documentation//localhost:8214

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.