For newly-introduced developers, how to install Ruby, the operating environment of Ruby Gems and Rails can be a problem, this page focuses on how to quickly install a ruby development environment with a reliable path.
The secondary installation method is also applicable to the product environment!
System Requirements
First determine the operating system environment, it is not recommended to engage in Windows, so you need to use:
- Mac OS X
- Any Linux distribution (Ubuntu,centos, Redhat, ArchLinux ...)
Strong novice use Ubuntu saves unnecessary hassle!
The following code area, with a $ first representation, needs to be performed under the Console (terminal) (not including the $ symbol)
Step 0-Install the package required by the system
# For Mac
# First install [Xcode] (http://developer.apple.com/xcode/) development tools, it will help you install the development packages required 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 is RVM do not explain here, you will slowly understand the back.
$ curl-l Https://get.rvm.io | Bash-s Stable
You may be asked for a sudo administrator password, and youhomebrewcan install the RVM successfully after a period of time by installing the dependent packages automatically.
Then, load into the RVM environment (new open termal will not do so, will automatically reload)
SOURCE ~/.RVM/SCRIPTS/RVM
Check to see if the installation is correct
(Stable[https://rvm.io/]
Step 2-Install the Ruby environment with RVM
$ RVM Install 2.0.0
Also continue to wait for a lengthy download, the compilation process, after completion, Ruby, Ruby Gems is installed.
Step 3-Set up Ruby version
After the RVM is installed, you need to execute 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 if you have a RVM install installed that version
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 3 steps above, the Ruby environment is installed, and the next step is to install Rails
$ gem Install Rails
Then test that the installation is correct
$ rails-vrails 3.2.13
Then start your ruby,rails trip.
Welcome to the world of Ruby!
Other resources
HTTPS://GITHUB.COM/HUACNLEE/INIT.D-Rapid installation of Ubuntu Server batch scripts for production environments
Refer
http://ruby.taobao.org/
Https://ruby-china.org/wiki/install_ruby_guide
Install Ruby, Rails running environment