# Rubygems local install

**URL:** <https://www.ruby-forum.com/t/rubygems-local-install/77418>\
**Category:** Ruby\
**Created:** [November 27, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418 "2006-11-27T20:16:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 27, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/1 "2006-11-27T20:16:24Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 27, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/2 "2006-11-27T20:30:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 28, 2006, 12:07am UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/3 "2006-11-28T00:07:11Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 28, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/4 "2006-11-28T15:37:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 28, 2006, 9:36am UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/5 "2006-11-28T09:36:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [November 28, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/rubygems-local-install/77418/6 "2006-11-28T17:25:31Z")

</div>

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.
