Install the ruby and rails runtime environments quickly and correctly

Source: Internet
Author: User

Ubuntu installation and Development Kit

$Sudo apt-Get install wget Vim build-essential OpenSSL libreadline6 libreadline6-dev curl Git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev Autoconf automake libtool ImageMagick libpcre3-dev

Step 1-install rvm

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

$Bash <(curl-s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

After waiting for a while, you can successfully install rvm. At this time, there will be a prompt that you wantCodePut in ~ /. Bashrc or ~ /. Bash_profile (MAC.

# Note thatChange/users/Jason to your home path, such as/home/lgn21st.

[[-S"/Users/Jason/. Rvm/scripts/rvm "] & source"/Users/Jason/. Rvm/scripts/rvm"

Then reload the. bashrc or. bash_profile file.

$Source ~ /. Bash_profile

Test whether the installation is correct

$Rvm-V

Rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

Step 2-Use rvm to install the ruby Environment

$Rvm PKG install Readline

$Rvm install 1.9.2-with-Readline-Dir = $ rvm_path/usr

You can also install version 1.8.7 or 1.9.3. You only need to change the later version.

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 1.9.2-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 1.9.2p290 (Revision 32553) [x86_64-darwin10.8.0]

$Gem-V

1.8.6

$Gem source-r http://rubygems.org/

$Gem source-A http://ruby.taobao.org

Step 4-install the rails Environment

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

$Gem install bundler rails

Then test whether the installation is correct.

$Bundle-V

Bundler Version 1.0

$Rails-V

Rails 3.2.1

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.