Fast and correct installation of Ruby, Rails running environment _ruby topics

Source: Internet
Author: User
Tags curl readline administrator password

How to quickly and correctly install Ruby, Rails to run the environment

For new entry-level developers, how to install Ruby, Ruby Gems and Rails running environments can be a problem, and this page focuses on how to quickly install a ruby development environment with a plausible path.
The secondary installation method also applies to the product environment!

System Requirements
first determine the operating system environment, not recommended on Windows, so you need to use:

Mac OS X
• Arbitrary Linux distributions (Ubuntu,centos, Redhat, ArchLinux ...)
The strong novice uses Ubuntu to dispense with unnecessary trouble!

The following area of code, with a $ beginning representation needs to be executed below the console (terminal) (excluding the $ symbol)

Step 0-Install the package required by the system

# for MAC
# first install [Xcode] (http://developer.apple.com/xcode/) development tool, it will help you install the Unix environment needs of the development package
# 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 here is not explained, and you will be able to figure it out later.

$ curl-l Https://get.rvm.io | Bash-s Stable

The period may ask you the sudo administrator password, as well as automatically installs the dependency package through the homebrew, waits for a period of time can successfully install good RVM.

Then, load the RVM environment (the new open termal do not have to do so, will automatically reload)

$ source ~/.RVM/SCRIPTS/RVM

Check to see if the installation is correct

$ rvm-v
RVM 1.22.17 (Stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [HTTPS://RV m.io/]

Step 2-Install Ruby environment with RVM

$ RVM Install 2.0.0

Also continue to wait for the long download, the compilation process, when finished, Ruby, Ruby Gems is installed.

Step 3-Set Ruby version
RVM installed, you need to perform the following command to set the specified version of Ruby to the system default version

$ RVM 2.0.0--default

Also, you can use a different version number, provided you have the RVM install installed that version.

This time you can test if it's right

$ 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 3 steps above, the Ruby environment is installed, and then Rails is installed

$ gem Install rails then test that the installation is correct

$ rails-v
Rails 3.2.13
--------------------------------------------------------------------------------

Then start your ruby,rails trip.
Welcome to Ruby's world!

Other resources
HTTPS://GITHUB.COM/HUACNLEE/INIT.D-Ubuntu Server Bulk script for rapid installation of production environments

Other Netizen's supplement:

Ubuntu Installation, development kits

$ 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 here is not explained, and you will be able to figure it out later.

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

Wait for a while before you can successfully install the RVM, this time there will be a hint, want you to put the code similar to the ~/.BASHRC or ~/.bash_profile (MAC) at the end.

# Pay attention to changing/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-Install Ruby environment with RVM

$ RVM pkg Install readline

$ RVM Install 1.9.2–with-readline-dir= $RVM _path/usr

Or you can install the 1.8.7 version, or it can be 1.9.3, as long as the following version number with a change on it

Also continue to wait for the long download, the compilation process, when finished, Ruby, Ruby Gems is installed.

Step 3-Set Ruby version

RVM installed, you need to perform the following command to set the specified version of Ruby to the system default version

$ RVM 1.9.2–default

Also, you can use a different version number, provided you have the RVM install installed that version.

This time you can test if it's right

$ ruby-v

Ruby 1.9.2p290 (2011-07-09 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 3 steps, the Ruby environment is installed, and then Rails is installed.

$ gem Install bundler rails

Then test that 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.