RVM, or Ruby Version Manager is a popular and effective way to manage running multiple Ruby environments. Here is how you set it up on CentOS 5.5:
1) Add the Webtatic respository and install Git.
(Note that this command will also install the perl-Error and perl-Git dependencies)
2) Create an rvm user and group.
1
2
groupadd rvm
useradd -g rvm rvm
3) Add the root user to the rvm group (required for installation)
1
usermod -a -G rvm root
4) Install RVM as root.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bash < <(curl -L http://bit.ly/rvm-install-system-wide)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5840 100 5840 0 0 1620 0 0:00:03 0:00:03 --:--:-- 5653
Group 'rvm' exists, proceeding with installation.
Adding 'root' to the group 'rvm'
Creating the destination dir and making sure the permissions are correct
Cloning into rvm...
remote: Counting objects: 4206, done.
remote: Compressing objects: 100% (2029/2029), done.
Receiving objects: 26% (1094/4206), 796.00 KiB | 54 KiB/s
....
Setting up group permissions
Generating system wide rvmrc
Generating /usr/local/lib/rvm to load rvm
Correct permissions on rvmrc and the rvm loader
RVM is now installed. To use, source '/usr/local/lib/rvm' to your shell profile.
5) Install zlib via RVM.
1
2
3
4
5
6
7
8
9
# rvm package install zlib
Fetching zlib-1.2.5.tar.gz to /usr/local/rvm/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 531k 100 531k 0 0 206k 0 0:00:02 0:00:02 --:--:-- 226k
Extracting zlib-1.2.5.tar.gz to /usr/local/rvm/src
Configuring zlib in /usr/local/rvm/src/zlib-1.2.5.
Compiling zlib in /usr/local/rvm/src/zlib-1.2.5.
Installing zlib to /usr/local/rvm/usr