Three ways to install Ruby language in Ubuntu system _ruby topics

Source: Internet
Author: User
Tags curl


Ruby is an open source dynamic programming language that has beautiful syntax for building scalable Web applications. Ruby Gems can be a good way to improve the development efficiency of ruby developers.



There are several ways to install Ruby on an Ubuntu system, and each method takes only a few steps to get it done.



Method One: Use Apt-get installation
You can complete the installation of Ruby using two commands directly.


 code as follows:

# sudo apt-get update
# sudo apt-get install ruby

Or
 code as follows:

# sudo apt-get install ruby2.0

method Two: Use Brightbox PPA warehouse installation
code as follows:

# sudo apt-get install python-software-properties
# sudo apt-add-repository ppa:brightbox/ruby-ng
# sudo apt-get update
# sudo apt-get install ruby2.1 Ruby2.1-dev

method Three: Use RVM installation
RVM is the version Manager tool for Ruby.
1. Installation RVM
 code as follows:

# sudo Apt-get Curl
# curl-l Https://get.rvm.io | Bash-s Stable
# source ~/.RVM/SCRIPTS/RVM

2, the installation of RVM environmental dependence
 code as follows:

# RVM Requirements

3. Install Ruby
 code as follows:

# RVM Install Ruby

If you want to install more than one Ruby version on Ubuntu, you can use the following command to specify the use of RVM as the default Ruby version management.
 code as follows:

# RVM Use Ruby--default

Check the version of Ruby that is currently successfully installed
 code as follows:

# ruby-v

Install Gems 

 code as follows:


# Gem List
# gem install [gem-name]

Like Gem-name can write sass.
If you want to install gems locally, the commands are as follows:
code as follows:

# gem Install--local [path of gem file]

You can use the command to update installed gems, as follows:
 code as follows:

# Gem Update--system

Or
code as follows:

# Gem Update




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.