How to quickly and correctly install Ruby and rails runtime Environments

Source: Internet
Author: User

Https://ruby-china.org/wiki/install_ruby_guide

How to quickly and correctly install Ruby and rails runtime Environments

For new entry-level developers, installing Ruby, Ruby gems, and rails running environments may be a problem. This section describes how to quickly install the ruby development environment using a reliable path.
The installation method is also applicable to the product environment!

System Requirements

First, determine the operating system environment. It is not recommended to do this on windows, so you need to use:

  • Mac OS X
  • Any Linux release version (Ubuntu, centos, RedHat, archlinux ...)

It is strongly recommended that new users use Ubuntu to save unnecessary trouble!

In the following code area, the $ header must be executed under the console (terminal) (excluding the $ symbol)

Step 0-install the package required by the system
# For Mac
# Install [Xcode] (http://developer.apple.com/xcode/) development tools first, it will help you install the development packages needed by the Unix environment
# Then install [Homebrew] (http://brew.sh)
ruby -e "$ (curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Step 1-install rvm

What rvm is doing is not explained here, and you will understand it later.

$ curl -L https://get.rvm.io | bash -s stable

During this period, you may be asked about the sudo administrator password and automatically passhomebrewInstall the dependency package. After a while, you can successfully install rvm.

Then, load the rvm environment (New termal does not need to be done, it will automatically reload)

$ source ~/.rvm/scripts/rvm

Check whether the installation is correct

$ rvm -vrvm 1.22.17 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
Step 2-Use rvm to install the ruby Environment
$ rvm install 2.0.0

We will also continue to wait for a long download. After the compilation process is completed, Ruby and Ruby gems will be installed.

Step 3-set the ruby version

After the rvm is installed, You need to execute the following command to set the ruby of the specified version to the default version of the system.

$ rvm 2.0.0 --default

You can also use other versions, provided that you have installed the version with rvm install.

At this time, you can test whether it is correct.

$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.0] $ gem -v
2.1.6 $ gem source -r https://rubygems.org/ $ gem source -a https://ruby.taobao.org
Step 4-install the rails Environment

After the above three steps, the ruby environment is installed, and then the rails

$ gem install rails

Then test whether the installation is correct.

$ rails -v
Rails 3.2.13

Start your ruby and rails journey.
Welcome to the ruby world!

Other resources

Https://github.com/huacnlee/init.d-quick installation of production environment for Ubuntu server Batch scripts

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.