Building a ruby environment under Ubuntu

Source: Internet
Author: User

As a software engineering student, recently wanted to learn a scripting language, after some query, understand that Ruby and Python are pretty good choice, but may be more inclined to diversification and liberalisation, because python to achieve simplicity and efficiency, the adoption of a philosophy "in a way, There's only one way to do it, and of course this philosophy is pretty good, but I chose to learn Ruby first, but I'm sure I'll be back in the future to learn about Python, because learning a language can reduce the degree to which I'm captured by language and can think more about it.

Okay, now, let's talk about some of the things I've been up to in building the ruby environment.

First of all, if you just want to be able to run Ruby code, it is relatively simple to build a ruby environment under Ubuntu, directly under the terminal "sudo apt-get install ruby" can install the latest version of Ruby, but this will cause a problem, When you use a tool such as "Ri" in ruby similar to the Ubuntu Environment Man Handbook, you will find that it is always "nothing know about * * * * * * * * * * * * * * * * * * * * * * * * * * * *"

It is recommended that you install RVM, this thing is a command line tool that can provide a convenient multi-version ruby environment for management and switching.

Installation method, reference: Https://ruby-china.org/wiki/rvm-guide (supplemental "RVM get Stable" can upgrade RVM to the latest version)

With RVM you can easily work with the Ruby version and after installation, execute "RVM docs generate" to generate the document;

Whenever you want to use RI commands, you load the environment with "source ~/.bash_profile" and then you can use RI.

Add: Install RubyGems (abbreviated as: GEMS), this tool is equivalent to Apt-get, using it to easily download and install rails from a remote server.

Open terminal, enter execute command gem install rails--remote or gem install rails--include-dependencies.

Building a ruby environment under Ubuntu

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.