Three methods for installing Ruby in Ubuntu

Source: Internet
Author: User
Ruby is an open-source dynamic programming language. It has excellent syntax and can be used to build scalable Web applications. Rubygems can greatly improve the development efficiency of Ruby developers. There are several methods to install Ruby on Ubuntu, each of which can be completed in just a few steps. Method 1: Use apt-get to install Ruby directly using two commands. # Sudoapt-getupdate # sudoapt-getinstallr

Ruby is an open-source dynamic programming language. It has excellent syntax and can be used to build scalable Web applications. Ruby gems can greatly improve the development efficiency of Ruby developers.

There are several methods to install Ruby on Ubuntu, each of which can be completed in just a few steps.

Method 1: Install with apt-get

You can directly use two commands to install Ruby.

# Sudo apt-get update

# Sudo apt-get install ruby

Or

# Sudo apt-get install ruby2.0

Method 2: Use the brightbox ppa repository for Installation

# 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 3: Install with RVM

RVM is a Ruby version manager tool.

1. Install RVM

# Sudo apt-get curl

# Curl-L https://get.rvm.io | bash-s stable

# Source ~ /. Rvm/scripts/rvm

2. environment dependency for installing RVM

# Rvm requirements

3. Install Ruby

# Rvm install ruby

If you want to install multiple Ruby versions on Ubuntu, you can use the following command to specify rvm as the default Ruby version management.

# Rvm use ruby -- default

Check the Ruby version that is successfully installed.

# Ruby-v

Install gems

# Gem list

# Gem install [gem-name]

For example, you can write sass with gem-name.

To install gems locally, run the following command:

# Gem install -- local [path of gem file]

You can run the following command to update installed gems:

# Gem update -- system

Or

# Gem update

Http://www.linuxidc.com/Linux/2015-01/111525.htm of file methods for traversing a specified directory in Ruby

Build Ruby On Rails http://www.linuxidc.com/Linux/2012-06/61981.htm in Ubuntu

Build Ruby on Rails http://www.linuxidc.com/Linux/2014-02/96399.htm on Ubuntu 13.10

Ruby on Rails 4 Tutorial Chinese HD complete PDF http://www.linuxidc.com/Linux/2014-04/100253.htm

Ruby: Click here
Ruby: Click here

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-03/114450.htm

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.