Search code examples
rubyrubygemsinstallationshared-hostinghome-directory

Install newer version of RubyGems on user directory : system-wide installation is still being used?


I have an user account on a shared Debian system that has RubyGems 1.1.1 installed and I can't make them upgrade it, at least at the moment.

I'm trying to install a new RubyGems installation locally on my home directory, following the instructions from RubyGems user guide chapter 3.2 Installing RubyGems in a User Directory.

So far, I got now latest RubyGems (1.8.10) installed at $HOME/rubygems and I have fixed the following environment variables:

  • GEM_HOME to $HOME/rubygems/gems
  • PATH to have $HOME/rubygems/bin before systemwide /usr/bin (which contains the old gem)

Path should be working OK, since which gem results as $HOME/rubygems/bin/gem.

Still, when I run gem -v I get 1.1.1.

This probably has something to do with ruby require ending up to the system-wide files of RubyGems, since the $HOME/rubygems/bin/gem starts with

require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'

What should I do to get my local-installed-version 1.8.10 running?

br, Touko


Solution

  • I don't know if this is exactly what you want. But the easiest way would probably be to use rvm. https://rvm.beginrescueend.com/rvm/install/

    With rvm you could have your own self contained ruby environment in your home directory with exactly the tools that you need.