Install Ruby, Rails runtime environment, and rubyrails quickly and correctly

Source: Internet
Author: User

Install Ruby, Rails runtime environment, and rubyrails quickly and correctly

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
# First install the [Xcode] (http://developer.apple.com/xcode/) development tool, it will help you install the Development Kit required for the Unix environment
# 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 install the dependency package through homebrew. 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-v
Rvm 1.22.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [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 (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 and 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

Supplemented by other netizens:

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, you will be prompted to put the code similar to this section in ~ /. Bashrc or ~ /. Bash_profile (Mac.

# Change/Users/jason to your home path, for example,/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


How to install ruby on rails

It depends on the system you installed.
Installing mac and linux is the same thing.
For more information, see www.javaeye.com/...-linux.
Windows is one thing.

Installing Rails is divided into 2. * or 3. *

If windows is used, xp is strongly recommended.
Do not install Windows 7 or any 64-bit system,

Finally, I will introduce the simplest way for you to try it.
It means you have installed it with instant. Refer to the introduction below, or Baidu rails instant.
Hi.baidu.com/...7.html
Reference: hi.baidu.com/...7.html

How to determine whether ruby rails is successfully installed

Enter the following two commands on the terminal:
Ruby-v
If rails-v displays the corresponding version information, the installation is successful.

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.