What is rvm?
Rvm is Ruby Version Manager, a command line tool developed by Wayne E. Seguin. Rvm allows you to easily install and manage ruby productivity environments, such as interpreters and gems of different versions.
Rvm project official site is: https://rvm.beginrescueend.com/
Install rvm
Here we will only discuss the installation of a single user, that is, the rvm will be installed in the user's main folder. At the same time, our environment is Ubuntu 11.04.
Rvm needs to use the curl tool to download an installation script. At the same time, the downloaded script also needs to use git to download the source code from GitHub. Therefore, if curl and git are not installed, run the following command:
Sudo apt-get install curl git
Everything is ready. download and execute the installation script through curl (please do not use root for execution ):
$ Bash <(curl-s https://rvm.beginrescueend.com/install/rvm)
After the installation is complete, you will see a lot of information about how to install it later. In earlier versions, you must install ~ /. Add configuration information to the bashrc file, but now the installation script is smart to help you complete this step. Optional parameter ~ The setup_user_profiles () function in/. rvm/src/rvm/scripts/funcionts/installer.
However, you 'd better check whether your. bashrc has the following configuration information:
[[-S "$ HOME /. rvm/scripts/rvm "] & source" $ HOME /. rvm/scripts/rvm "# Load RVM into a shell session * as a function *
Re-open the terminal (so that he can reload the. bashrc file) and confirm that rvm has been installed:
$ Rvm-v
Rvm 1.6.25 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]
Once rvm is installed.
Install Ruby
Before installing ruby, you need to install the following optional steps:
$ Sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
Then there is readline. This step is also required during manual compilation:
$ Rvm pkg install readline
Install ruby-1.9.2-p290, of course, you can also install the version you need, rvm will automatically download for you, compile:
$ Rvm install 1.9.2-p290 -- with-readline-dir = $ rvm_path/usr
View the installed ruby environment:
View the installed ruby environment:
$ Rvm list
Rvm rubies
Ruby-1.9.2-p290 [i386]
Set the installed ruby-1.9.2-p290 to the default working environment:
$ Rvm -- default use 1.9.2-p290
Happy game!
Install rvm on CentOS
Use crontab to call the rake command under rvm
Use rvm to install ruby and rails on Mac
Use rvm in Ubuntu