# RVM Installation For Single User, Multi User, Mixed Mode
# Overview
There are three different ways to install and configure RVM.
-
Single-User installations (recommended) - For an isolated install within a user’s $HOME, not for root.
-
Multi-User installations - For server administrators - For an installation usable by all users on the system - Please note that Single-
User supercedes Multi-User. This also used to be called the System-Wide Install. Using this type of installation without knowledge how umask works is a big security risk.
-
Mixed mode installations - For an installation usable by all users on the system - with isolated rubies/gemsets within a user’s $HOME. Installation instructions are exactly the same as for Multi-User installations, the difference is in users environment.
# Installing Curl
sudo apt-get install curl
# First run rvm requirements
rvm requirements
# Next Download the additional dependencies mention there.
For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Single-User installation
Installing the stable release version:
\curl -L https://get.rvm.io | bash -s stable
Installing a specific version:
\curl -L https://get.rvm.io | bash -s -- --version latest \curl -L https://get.rvm.io | bash -s -- --branch [owner/][repo]
Debugging installation process:
\curl -L https://get.rvm.io | bash -s -- --trace
If the rvm install script complains about certificates you need to follow the displayed instructions.
Single-User Install Location: ~/.rvm/
NOTE: If the install script is run as a standard, non-root user, RVM will install into the current users’s home directory.
Modification of user configuration files (*rc / *profile) - RVM by default will modify user startup files, although it is not recommended you can disable automated process and do this manually (RVM version 1.18 / head):
\curl -L https://get.rvm.io | bash -s -- --ignore-dotfiles echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
# Multi User Installation:
\curl -L https://get.rvm.io | sudo bash -s stable
In this scenario in order to load RVM when any of the users start you need to edit /etc/bash.bashrc with root access:
sudo nano /etc/bash.bashrc
Add the following line in the end.
### # SOURCE RVM BASH SCRIPT ### source "/etc/profile.d/rvm.sh"
Note: The Multi-User install instructions must be prefixed with the ‘sudo’ command. However, once the install is complete, and the instructions to add users to the rvm group is followed, the use of either sudo or rvmsudo is no longer required. The ‘sudo’ command is only to temporarily elevate privileges so the installer can complete it’s work. If you need to use ‘sudo’ or ‘rvmsudo’ after the install is complete, some part of the install directions were not properly followed. This usually is because people execute the install as root, rather than executing the installation instructions from a non-privileged user account.
Next see if user is in rvm group by running the command
groups
If the user is already in the rvm group skip the next step If the user is not in the rvm group, then to add user to the group
sudo usermod -a -G rvm <<username>>
# Installing Ruby
Known Rubies
rvm list known
Find the requirements
rvm requirements
Install ruby
rvm install ruby-2.0.0-p0
To set it to default
rvm --default use 2.0.0-p0
Check this worked correctly
ruby -v which ruby
To show what ruby is currently the selected default, if any, do
rvm list default
# References:
rvm.io install - rvm.io/rvm/install/ rvm.io best practices - rvm.io/rvm/best-practices/
# Official Site:
rvm.io - rvm.io/
# Issues:
rvm.io-troubleshooting - rvm.io/support/troubleshooting/