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
- Any 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 Kit
# 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://rvm.io/]
Step 2-Install Ruby environment with RVM
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
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
Then test that the installation is correct
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