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