Because the system was reinstalled, we tried to use rvm to install and manage Ruby and rails and record the installation process.
Install curl first
Shell code
- $ Sudo apt-Get install curl
Because the rvm Installation File is obtained from GitHub through git, a local git is also required. I installed it through build, you can also install the SDK directly from APT using the following command.
Shell code
- $ Sudo apt-Get install Git-core
Install rvm
Shell code
- $ Bash <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
After the installation is complete, configure the startup environment and modify ~ /. Add the bashrc File
Java code
- # Add rvm
- If [[-s "$ home/. rvm/scripts/rvm"]; then
- Source "$ home/. rvm/scripts/rvm ";
- Fi
In the new terminal, you can see whether the rvm has been successfully installed:
Shell code
- $ Rvm notes
You can see some information about the rvm displayed on the screen.
After installing rvm, you can use TA to install and manage Ruby. Run the following command to install Ruby 1.9.2:
Shell code
- $ Rvm install 1.9.2
* The download of the Ruby package is too slow, and it is always interrupted. You can download ruby-1.9.2-p0.tar.bz2 with the tool and manually place it in ~ /. Rvm/archives directory. Then run this command to decompress and install it.
Set Ruby of this version as the default
Java code
- $ Rvm -- default ruby-1.9.2-ruby-1.9.2-p0
After compilation and installation are complete, run the following command to test
Java code
- $ Ruby-V
If the following information is displayed on the screen, the installation is successful.
Ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Install rails 3
Shell code
- $ Gem install rails
Run the rails-V test.
Shell code
- $ Rails-V
The latest version of rails 3.0.3 is displayed.