First of all: You could just use RVM Show archive.org snapshot which would make the pain go away. If for some reason you can't, proceed.
Do not use rubygems from the apt repository.
- Get the latest RubyGems Show archive.org snapshot TGZ
- Change to the download directory and extract it:\
tar xvfz rubygems-1.3.7.tgz
- If you previously had RubyGems installed via apt: \
sudo apt-get remove rubygems
- Install RubyGems:\
cd rubygems-1.3.7 && sudo ruby setup.rb
- Link
gem
togem1.8
:\
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
If gem list
does not show all gems you previously had, you can create a symlink to your old gem directory:\
cd /usr/local/lib/ruby && sudo mv gems gems-rubygems && sudo ln -s /var/lib/gems gems
If you need to have the rubygems
package installed on Ubuntu
Due to a dependency from another package, you might have APT force the rubygems
package (or uninstalling it like above would remove more packages than you want).\
Here is how to override the RubyGems version supplied by APT.
A solution for this problem is to create own deb packages for rubygems from the tar.gz.\
You can do this by using checkinstall
:
- Download and extract RubyGems (like above)
- Instead of running
setup.rb
directly, usecheckinstall
: \
cd rubygems-1.3.7 && checkinstall ruby setup.rb
(do checkinstall with sudo if you want to install the created deb directly) - Follow instructions on screen.
- You now have a
.deb
file that you can install, overwriting the system version:\
sudo dpkg -i rubygems_1.3.7-1_amd64.deb
- Link
gem
togem1.8
(see above)
Attached are two (32 and 64 bit) .deb
packages from 2011-08-12, kindly built by Kim.