Installing RVM in a multiuser setup on Ubuntu
Published by Joe Lovick on March 19th, 2015
Is not as easy as it sounds, you need to be within the full root environment,
to achieve this we sudo -s to root shell, and then su to create a isolated root environment.
full session transcript....
jlovick@plankton:~$ sudo -s
root@plankton:~# su
root@plankton:/home/jlovick# cd /tmp/
root@plankton:/home/jlovick# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
root@plankton:/tmp# curl -L https://get.rvm.io | sudo bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 862 0 --:--:-- --:--:-- --:--:-- 1150
100 22817 100 22817 0 0 49363 0 --:--:-- --:--:-- --:--:-- 49363
Downloading https://github.com/wayneeseguin/rvm/archive/1.26.10.tar.gz
Downloading https://github.com/wayneeseguin/rvm/releases/download/1.26.10/1.26.10.tar.gz.asc
gpg: Signature made Mon 02 Feb 2015 10:09:00 AM CST using RSA key ID BF04FF17
gpg: Good signature from "Michal Papis (RVM signing)"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
GPG verified '/usr/local/rvm/archives/rvm-1.26.10.tgz'
Installing RVM to /usr/local/rvm/
test -f /etc/profile.d/rvm.sh && source /etc/profile.d/rvm.sh
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Administrator,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
root@plankton:/tmp# source /etc/profile.d/rvm.sh
root@plankton:/tmp# rvm install ruby
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.2.0.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.2.0 - #configure
ruby-2.2.0 - #download
root@plankton:~# su
root@plankton:/home/jlovick# cd /tmp/
root@plankton:/home/jlovick# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
root@plankton:/tmp# curl -L https://get.rvm.io | sudo bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 862 0 --:--:-- --:--:-- --:--:-- 1150
100 22817 100 22817 0 0 49363 0 --:--:-- --:--:-- --:--:-- 49363
Downloading https://github.com/wayneeseguin/rvm/archive/1.26.10.tar.gz
Downloading https://github.com/wayneeseguin/rvm/releases/download/1.26.10/1.26.10.tar.gz.asc
gpg: Signature made Mon 02 Feb 2015 10:09:00 AM CST using RSA key ID BF04FF17
gpg: Good signature from "Michal Papis (RVM signing)
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
GPG verified '/usr/local/rvm/archives/rvm-1.26.10.tgz'
Installing RVM to /usr/local/rvm/
test -f /etc/profile.d/rvm.sh && source /etc/profile.d/rvm.sh
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Administrator,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
root@plankton:/tmp# source /etc/profile.d/rvm.sh
root@plankton:/tmp# rvm install ruby
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/12.04/x86_64/ruby-2.2.0.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.2.0 - #configure
ruby-2.2.0 - #download
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.0 - #validate archive
ruby-2.2.0 - #extract
ruby-2.2.0 - #validate binary
ruby-2.2.0 - #setup
ruby-2.2.0 - #gemset created /usr/local/rvm/gems/ruby-2.2.0@global
ruby-2.2.0 - #importing gemset /usr/local/rvm/gemsets/global.gems....................................
ruby-2.2.0 - #generating global wrappers........
ruby-2.2.0 - #gemset created /usr/local/rvm/gems/ruby-2.2.0
ruby-2.2.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.0 - #generating default wrappers........
ruby-2.2.0 - #validate archive
ruby-2.2.0 - #extract
ruby-2.2.0 - #validate binary
ruby-2.2.0 - #setup
ruby-2.2.0 - #gemset created /usr/local/rvm/gems/ruby-2.2.0@global
ruby-2.2.0 - #importing gemset /usr/local/rvm/gemsets/global.gems....................................
ruby-2.2.0 - #generating global wrappers........
ruby-2.2.0 - #gemset created /usr/local/rvm/gems/ruby-2.2.0
ruby-2.2.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.0 - #generating default wrappers........
root@plankton:/tmp# sudo adduser jlovick rvm
Adding user `jlovick' to group `rvm' ...
Adding user jlovick to group rvm
Done.
root@plankton:/tmp# sudo adduser nginx rvm
Adding user `nginx' to group `rvm' ...
Adding user nginx to group rvm
Done.
Adding user `jlovick' to group `rvm' ...
Adding user jlovick to group rvm
Done.
root@plankton:/tmp# sudo adduser nginx rvm
Adding user `nginx' to group `rvm' ...
Adding user nginx to group rvm
Done.