Rubygems local install

This is part question - part comment…

I’m installing a local (non-root) gems. I’ve succeeded in doing this,
however I had a problem I thought I might bring to the attention of the
community.

First… installing on a Debian testing distro. Ruby installed via
apt-get.

following these instructions…
http://docs.rubygems.org/read/chapter/3#page83

when doing install step… (ruby setup.rb install)

I kept getting a directory not found error related to line 71 of
“rubygems-0.9.0/post-install.rb”.

( Dir.chdir(“pkgs/sources”) do )

when I changed this line to…

( Dir.chdir(“/home/my_user/rubygems-0.9.0/pkgs/sources”) do )

then it all worked.

But I get real nervous when I need to change code like that, mostly for
future maintenance reasons.

Am I doing something wrong? Is there a directory path I’m neglecting
to set properly? Or do other people also hack through this bit?

Any help is much appreciated.

Thank You,

Andy K.

andy wrote:

/ …

when I changed this line to…

( Dir.chdir("/home/my_user/rubygems-0.9.0/pkgs/sources") do )

then it all worked.

But I get real nervous when I need to change code like that, mostly for
future maintenance reasons.

Am I doing something wrong?

The initial launch assumes that you are in your home directory
(/home/local_user). If you are not, this error will come up. You were
not
in your home directory.

Further Problems with this topic…

My initial effort involved a Debian machine that had the rubygems
package previously installed. Thus I believe my success was a false
positive.

Repeating the process listed in
http://docs.rubygems.org/read/chapter/3#page83 on a ruby/rubygems
“clean” Debian box, I consistently get the error…

/home/andy/mystuff/bin/gem:9:in ‘require’: no such file to load –
rubygems (LoadError)
from /home/andy/mystuff/bin/gem:9

I would interpret this as the ruby not finding the rubygems.rb file.
However, I’ve followed the instructions precisely - several times.
Unless I install the Debian package libgems-ruby1.8, I get this error.
But this defeats the purpose of a user install ruby gems.

Any thoughts on what I’m missing? Or misunderstanding?

regards,

Andy K.

On Mon, 27 Nov 2006 11:13:14 -0800, andy wrote:

This is part question - part comment…

I’m installing a local (non-root) gems. I’ve succeeded in doing this,
however I had a problem I thought I might bring to the attention of the
community.

I have a system where rubygems is installed systemwide by root (so the
rubygems library, and binaries are systemwide), and I set GEM_HOME to
/home/bloom/.gems, installed the sources gem locally, and consequently
have a local gem directory.

–Ken

I installed rubygems to /data/rubygems and added this to my
environment:

RUBYLIB=/data/rubygems/lib/ruby/site_ruby/1.8

Any use?

Jeremy H.

Hi Jeremy,

Setting RUBYLIB was the piece I’ve been missing, thanks for the
insight.

Ken,

I tried the system rubygems. However, I have some ruby scripts that
needed to start on boot and this caused grief as they kept failing when
they looked only in standard rubygem dir and didn’t find the rubygems I
installed as local user.

By setting PATH, GEM_HOME and RUBYLIB in my boot scripts they
correctly locate my local user ruby gems.

Many thanks,

Andy K.