tags:

views:

244

answers:

3

I'm trying to setup a second ruby install in my home directory (a different version of ruby for testing). I've compiled ruby into ~/bin/ and everything is working until I try to install rubygems.

I have GEM_HOME set to ~/gems directory and GEM_PATH set to the same. Then I try to install rubygems with

~/bin/ruby setup.rb

The installation appears to succeed but ruby can't find rubygems after the install.

$~/bin/irb
irb(main):001:0> require 'rubygems'
LoadError: no such file to load -- rubygems
    from (irb):1:in `require'
    from (irb):1

Anyone have any idea why ruby can't find rubygems?

+3  A: 

In addition to setting GEM_HOME you need to run config with your path. Here are the steps from rubygems.org.

$ export GEM_HOME=/home/mygemrepository
$ ruby setup.rb config --prefix=/home/mystuff
$ ruby setup.rb setup
$ ruby setup.rb install
Gordon Wilson
A: 

that fails in exactly the same way. I believe prefix is telling setup.rb where to put rubygems but isn't telling ruby where to find it. Also, the steps from rubygems.org is a different situation. They are installing rubygems in their home folder, but using the systems ruby binary. I'm trying to use a ruby binary from my home folder.

jshen
A: 

ok, I got it to work. Sometimes a fresh day is all it takes.

The solution 1. i used an older version of gems (1.1.1. to be precise) 2. i didn't use the prefix but i did set GEM_HOME and GEM_PATH

jshen