# Rubygems install problems (the old ubygems (LoadError) problem. Sigh)

**URL:** <https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071>\
**Category:** ruby-talk\
**Created:** [29 December 2006 00:30 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071 "2006-12-29T00:30:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Van\_Delst](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Paul\_Van\_Delst](https://rubytalk.org/u/Paul_Van_Delst)\
**Post date:** [29 December 2006 00:30 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/1 "2006-12-29T00:30:06Z")

</div>

Hello,

I just did a complete re-install of ruby 1.8.5-p12 and rubygems-0.9.0 and I'm getting the old sawhorse error:

ruby: no such file to load -- ubygems (LoadError)

I've searched the newsgroup, but nothing seems to address the problem I'm having (I think). Here's what I did:

0) rm -fr'd my "ruby" and "rubygems" installation directories in my $HOME/local (I do not have root access to the computer in question). Also unset RUBYOPT.

ruby install

> **···**
>
> ------------  
> 1) Installed ruby 1.8.5-p12. No problems  
> 2) Modified my login script with:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/ruby/bin  
> &nbsp;&nbsp;&nbsp;&nbsp;ruby and irb run fine.
> 
> rubygems install  
> ----------------  
> 3) Specified where I want gems to actually go,  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> 4) ruby setup.rb config --prefix=${HOME}/local/rubygems  
> 5) ruby setup.rb setup  
> 6) ruby setup.rb install  
> &nbsp;&nbsp;&nbsp;&nbsp;....  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Successfully built RubyGem  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name: sources  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version: 0.0.1  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File: sources-0.0.1.gem  
> 7) In login script added  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/rubygems/bin  
> &nbsp;&nbsp;&nbsp;&nbsp;and  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export RUBYOPT="rubygems"
> 
> Now I want to install a gem (Bil Kleb's funit) and I did:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;gem install funit
> 
> and got the error:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;ruby: no such file to load -- ubygems (LoadError)
> 
> And, of course, ruby and irb no longer work either (same error).
> 
> O.k., so what did I do wrong? \*After\* I installed rubygems I set the RUBYOPT envar. But, ruby can't seem to find anything rubygem related.
> 
> Is there some other magical envar that I need to set so that ruby and rubygems play nice?
> 
> Or should I install rubygem "inside" my ruby install? In:  
> &nbsp;&nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby/1.8/i686-linux ?  
> or  
> &nbsp;&nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby  
> or  
> &nbsp;&nbsp;&nbsp;??
> 
> I followed the notes I made last time I did this[\*] and it worked then, so I've screwed something up somewhere; I just don't know what.
> 
> Any help/info appreciated.
> 
> cheers,
> 
> paulv
> 
> [\*] Said notes being a little sketchy, hence my starting from scratch effort.
> 
> --  
> Paul van Delst Ride lots.  
> CIMSS @ NOAA/NCEP/EMC Eddy Merckx

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [29 December 2006 00:50 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/2 "2006-12-29T00:50:27Z")

</div>

> I just did a complete re-install of ruby 1.8.5-p12 and rubygems-0.9.0 and I'm getting the old sawhorse error:
> 
> ruby: no such file to load -- ubygems (LoadError)
> 
> I've searched the newsgroup, but nothing seems to address the problem I'm having (I think). Here's what I did:
> 
> 0) rm -fr'd my "ruby" and "rubygems" installation directories in my $HOME/local (I do not have root access to the computer in question). Also unset RUBYOPT.
> 
> ruby install  
> ------------  
> 1) Installed ruby 1.8.5-p12. No problems  
> 2) Modified my login script with:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/ruby/bin  
> &nbsp;&nbsp;&nbsp;ruby and irb run fine.
> 
> rubygems install  
> ----------------  
> 3) Specified where I want gems to actually go,  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> 4) ruby setup.rb config --prefix=${HOME}/local/rubygems

This tells ruby to put ubygems.rb under ~/local/rubygems.

> 5) ruby setup.rb setup  
> 6) ruby setup.rb install  
> &nbsp;&nbsp;&nbsp;....  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Successfully built RubyGem  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name: sources  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version: 0.0.1  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File: sources-0.0.1.gem

This puts ubygems.rb under ~/local/rubygems.

> 7) In login script added  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/rubygems/bin  
> &nbsp;&nbsp;&nbsp;and  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export RUBYOPT="rubygems"
> 
> Now I want to install a gem (Bil Kleb's funit) and I did:
> 
> &nbsp;&nbsp;&nbsp;gem install funit
> 
> and got the error:
> 
> &nbsp;&nbsp;&nbsp;ruby: no such file to load -- ubygems (LoadError)
> 
> And, of course, ruby and irb no longer work either (same error).

ubygems.rb is not in your $LOAD\_PATH for ruby.

> O.k., so what did I do wrong? \*After\* I installed rubygems I set the RUBYOPT envar. But, ruby can't seem to find anything rubygem related.
> 
> Is there some other magical envar that I need to set so that ruby and rubygems play nice?

You probably want to add:

export RUBYLIB=${HOME}/local/rubygems

> Or should I install rubygem "inside" my ruby install? In:  
> &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby/1.8/i686-linux ?  
> or  
> &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby  
> or  
> &nbsp;&nbsp;??

This is how rubygems is typically installed (by not supplying the --prefix option in step 4). But you do not have root access. You just needed to add rubygems to the $LOAD\_PATH.

> **···**
>
> On Dec 28, 2006, at 16:30, Paul van Delst wrote:
> 
> > I followed the notes I made last time I did this[\*] and it worked then, so I've screwed something up somewhere; I just don't know what.
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)
> 
> I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [29 December 2006 00:55 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/3 "2006-12-29T00:55:43Z")

</div>

Actually, from testing, it'll be more like ${HOME}/local/rubygems/lib/ruby/site\_ruby/1.8 or some-such.

> **···**
>
> On Dec 28, 2006, at 16:50, Eric Hodel wrote:
> 
> > On Dec 28, 2006, at 16:30, Paul van Delst wrote:
> > 
> > > Is there some other magical envar that I need to set so that ruby and rubygems play nice?
> > 
> > You probably want to add:
> > 
> > export RUBYLIB=${HOME}/local/rubygems
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)
> 
> I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![Paul\_Van\_Delst](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Paul\_Van\_Delst](https://rubytalk.org/u/Paul_Van_Delst)\
**Post date:** [29 December 2006 01:45 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/4 "2006-12-29T01:45:10Z")

</div>

Hi Eric,

Eric Hodel wrote:

> > I just did a complete re-install of ruby 1.8.5-p12 and rubygems-0.9.0 and I'm getting the old sawhorse error:
> > 
> > ruby: no such file to load -- ubygems (LoadError)
> > 
> > I've searched the newsgroup, but nothing seems to address the problem I'm having (I think). Here's what I did:
> > 
> > 0) rm -fr'd my "ruby" and "rubygems" installation directories in my $HOME/local (I do not have root access to the computer in question). Also unset RUBYOPT.
> > 
> > ruby install  
> > ------------  
> > 1) Installed ruby 1.8.5-p12. No problems  
> > 2) Modified my login script with:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/ruby/bin  
> > &nbsp;&nbsp;&nbsp;ruby and irb run fine.
> > 
> > rubygems install  
> > ----------------  
> > 3) Specified where I want gems to actually go,  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> > 4) ruby setup.rb config --prefix=${HOME}/local/rubygems
> 
> This tells ruby to put ubygems.rb under ~/local/rubygems.
> 
> > 5) ruby setup.rb setup  
> > 6) ruby setup.rb install  
> > &nbsp;&nbsp;&nbsp;....  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Successfully built RubyGem  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name: sources  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version: 0.0.1  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File: sources-0.0.1.gem
> 
> This puts ubygems.rb under ~/local/rubygems.
> 
> > 7) In login script added  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export GEM\_HOME=${HOME}/local/rubygemrepository  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export PATH=$PATH:${HOME}/local/rubygems/bin  
> > &nbsp;&nbsp;&nbsp;and  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export RUBYOPT="rubygems"
> > 
> > Now I want to install a gem (Bil Kleb's funit) and I did:
> > 
> > &nbsp;&nbsp;&nbsp;gem install funit
> > 
> > and got the error:
> > 
> > &nbsp;&nbsp;&nbsp;ruby: no such file to load -- ubygems (LoadError)
> > 
> > And, of course, ruby and irb no longer work either (same error).
> 
> ubygems.rb is not in your $LOAD\_PATH for ruby.
> 
> > O.k., so what did I do wrong? \*After\* I installed rubygems I set the RUBYOPT envar. But, ruby can't seem to find anything rubygem related.
> > 
> > Is there some other magical envar that I need to set so that ruby and rubygems play nice?
> 
> You probably want to add:
> 
> export RUBYLIB=${HOME}/local/rubygems

Well, I eventually figured out that I need  
&nbsp;&nbsp;&nbsp;export RUBYLIB=${HOME}/local/rubygems/lib/ruby/site\_ruby/1.8

Just specifying ${HOME}/local/rubygems didn't work.

> > Or should I install rubygem "inside" my ruby install? In:  
> > &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby/1.8/i686-linux ?  
> > or  
> > &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby  
> > or  
> > &nbsp;&nbsp;??
> 
> This is how rubygems is typically installed (by not supplying the --prefix option in step 4). But you do not have root access. You just needed to add rubygems to the $LOAD\_PATH.

This is going to make your eyes roll, but how does one add a root subdirectory to LOAD\_PATH so that ruby searches recursively down? The only way I can figure out how to modify LOAD\_PATH is to list every specific directory via the RUBYLIB envar -- which is rather onerous.

An online search didn't reveal anything clever.

cheers,

paulv

> **···**
>
> > On Dec 28, 2006, at 16:30, Paul van Delst wrote:
> 
> --  
> Paul van Delst Ride lots.  
> CIMSS @ NOAA/NCEP/EMC Eddy Merckx  
> Ph: (301)763-8000 x7748  
> Fax:(301)763-8545

---

<div class="post-metadata">

**Author:** ![Paul\_Van\_Delst](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Paul\_Van\_Delst](https://rubytalk.org/u/Paul_Van_Delst)\
**Post date:** [29 December 2006 02:05 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/5 "2006-12-29T02:05:06Z")

</div>

Eric Hodel wrote:

> > This is how rubygems is typically installed (by not supplying the --prefix option in step 4). But you do not have root access. You just needed to add rubygems to the $LOAD\_PATH.

Hello again,

O.k., I removed my old rubygems install and did it again but without the --prefix-dir and everything is now honky dory.

From the rubygems user manual installation help, I assumed that a "default" install would always go to /usr/lib/ruby/etc.... But it doesn't - it gets installed wherever ruby was installed (at least, that's what happened on my box).

Thanks for your patience.

cheers,

paulv

> **···**
>
> --  
> Paul van Delst Ride lots.  
> CIMSS @ NOAA/NCEP/EMC Eddy Merckx

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [29 December 2006 04:57 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/6 "2006-12-29T04:57:21Z")

</div>

You can't, and you don't really want this.

If you have lib/net/http.rb and recursively add everything you'll end up with the ability to require 'http' which may cause bad things to happen like double loading.

> **···**
>
> On Dec 28, 2006, at 17:45, Paul van Delst wrote:
> 
> > Eric Hodel wrote:
> > 
> > > On Dec 28, 2006, at 16:30, Paul van Delst wrote:
> > > 
> > > > Or should I install rubygem "inside" my ruby install? In:  
> > > > &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby/1.8/i686-linux ?  
> > > > or  
> > > > &nbsp;&nbsp;${HOME}/local/ruby/lib/ruby/site\_ruby  
> > > > or  
> > > > &nbsp;&nbsp;??
> > > 
> > > This is how rubygems is typically installed (by not supplying the --prefix option in step 4). But you do not have root access. You just needed to add rubygems to the $LOAD\_PATH.
> > 
> > This is going to make your eyes roll, but how does one add a root subdirectory to LOAD\_PATH so that ruby searches recursively down? The only way I can figure out how to modify LOAD\_PATH is to list every specific directory via the RUBYLIB envar -- which is rather onerous.
> > 
> > An online search didn't reveal anything clever.
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)
> 
> I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [29 December 2006 04:54 UTC](https://rubytalk.org/t/rubygems-install-problems-the-old-ubygems-loaderror-problem-sigh/34071/7 "2006-12-29T04:54:12Z")

</div>

Yes, this is correct.

I thought you were installing rubygems using the default (/usr/lib/ruby) installation, not your own.

> **···**
>
> On Dec 28, 2006, at 18:05, Paul van Delst wrote:
> 
> > Eric Hodel wrote:
> > 
> > > > This is how rubygems is typically installed (by not supplying the --prefix option in step 4). But you do not have root access. You just needed to add rubygems to the $LOAD\_PATH.
> > 
> > Hello again,
> > 
> > O.k., I removed my old rubygems install and did it again but without the --prefix-dir and everything is now honky dory.
> > 
> > From the rubygems user manual installation help, I assumed that a "default" install would always go to /usr/lib/ruby/etc.... But it doesn't - it gets installed wherever ruby was installed (at least, that's what happened on my box).
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)
> 
> I LIT YOUR GEM ON FIRE!
