- The "system ruby" is installed from the distribution packages
- Puppet is not anywhere in $LOAD_PATH except for the portion specified by the RUBYLIB environment variable, pointing at a VCS working copy.
- The same for Facter, MCollective, any software produced by Puppet Labs.
- Ruby Gems is not installed in the system paths. (We'll install it in a user path later on so we need the system to be nice and clean)
- A Bourne style shell is used by the account that will start jobs. (Bash or ZSH)
Make sure ruby-rdoc is installed. yum install ruby-rdoc
.
Clone this repository somewhere, or unpack the zipball from Github if you don't have Git installed.
Activate some gemset:
root@pe-centos5:~# GEMSET=alpha source /vagrant/src/set_runtime/bin/activate
Created /root/gemsets/alpha
(alpha)root@pe-centos5:~#
Ruby Gems 1.3.1 is what ships in EPEL, so that's what we're going to install.
(alpha)$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.1.tgz
(alpha)$ tar xvzf rubygems-1.3.1.tgz
(alpha)$ ruby setup.rb --prefix=$VIRTUAL_ENV
Now install some gem.
(alpha)root@pe-centos5:~# gem install rspec-core --version=2.8.0 --no-ri --no-rdoc
Successfully installed rspec-core-2.8.0
1 gem installed
(alpha)root@pe-centos5:~# gem list
*** LOCAL GEMS ***
rspec-core (2.8.0)
(alpha)root@pe-centos5:~# which ruby
/usr/bin/ruby
(alpha)root@pe-centos5:~# ruby --version
ruby 1.8.5 (2006-08-25) [i386-linux]
(alpha)root@pe-centos5:~# which gem
/root/gemsets/alpha/bin/gem
(alpha)root@pe-centos5:~# which rspec
/root/gemsets/alpha/gems/bin/rspec
(alpha)root@pe-centos5:~# rspec --version
2.8.0
Now switch to another shell and repeat the process, but with rspec 2.9.0 instead of 2.8.0 and GEMSET=beta
instead of GEMSET=alpha
$ ssh root@pe-centos5
Last login: Wed Apr 18 21:21:54 2012 from 172.16.214.1
root@pe-centos5:~# GEMSET=beta source /vagrant/src/set_runtime/bin/activate
Created /root/gemsets/beta
(beta)root@pe-centos5:~# cd rubygems-1.3.1
(beta)root@pe-centos5:~/rubygems-1.3.1# ruby setup.rb --prefix=$VIRTUAL_ENV
...
RubyGems installed the following executables:
/root/gemsets/beta/bin/gem
(beta)root@pe-centos5:~# gem install rspec-core --version=2.9.0 --no-ri --no-rdoc
Successfully installed rspec-core-2.9.0
1 gem installed
(beta)root@pe-centos5:~# gem list
*** LOCAL GEMS ***
rspec-core (2.9.0)
rspec-mocks (2.9.0)
(beta)root@pe-centos5:~# which ruby
/usr/bin/ruby
(beta)root@pe-centos5:~# ruby --version
ruby 1.8.5 (2006-08-25) [i386-linux]
(beta)root@pe-centos5:~# which gem
/root/gemsets/beta/bin/gem
(beta)root@pe-centos5:~# which rspec
/root/gemsets/beta/gems/bin/rspec
(beta)root@pe-centos5:~# rspec --version
2.9.0
EOF