# Can't install rubygems - but getting closer

**URL:** <https://www.ruby-forum.com/t/cant-install-rubygems-but-getting-closer/101714>\
**Category:** Ruby\
**Created:** [August 7, 2006, 4:47pm UTC](https://www.ruby-forum.com/t/cant-install-rubygems-but-getting-closer/101714 "2006-08-07T16:47:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 7, 2006, 4:47pm UTC](https://www.ruby-forum.com/t/cant-install-rubygems-but-getting-closer/101714/1 "2006-08-07T16:47:53Z")

</div>

I’m runniing Ubuntu Breezy. The distributed version of ruby is 1.8.3  
which is incompatible with the current rails. As a result, I’m trying to  
get things up outside of apt. I have ruby installed - compiled to  
install to /usr/bin. I’m trying to get rubygems installed, but still not  
making it there.

When I run (as root) ruby setup.rb, from the rubygems-0.9.0 directory,  
it terminates with

hook /software/rubygems-0.9.0/./post-install.rb failed:  
uninitialized constant Gem::Builder::Package

This is further than I’ve been getting, but still not there. I want to  
thank those of you for the help you’ve given so far, and need to ask for  
some more. Any ideas on how to correct this?

tia  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 7, 2006, 6:01pm UTC](https://www.ruby-forum.com/t/cant-install-rubygems-but-getting-closer/101714/2 "2006-08-07T18:01:54Z")

</div>

Michael S. wrote:

> I’m runniing Ubuntu Breezy. The distributed version of ruby is 1.8.3  
> which is incompatible with the current rails. As a result, I’m trying to  
> get things up outside of apt. I have ruby installed - compiled to  
> install to /usr/bin. I’m trying to get rubygems installed, but still not  
> making it there.
> 
> When I run (as root) ruby setup.rb, from the rubygems-0.9.0 directory,  
> it terminates with
> 
> hook /software/rubygems-0.9.0/./post-install.rb failed:  
> uninitialized constant Gem::Builder::Package
> 
> This is further than I’ve been getting, but still not there. I want to  
> thank those of you for the help you’ve given so far, and need to ask for  
> some more. Any ideas on how to correct this?
> 
> tia  
> —Michael

Gems for some reason on Debian/Ubuntu seems to want to install in  
/usr/lib/ruby instead of /usr/local (rather annoying) I’d take a look  
and see if that is what it did?

On Dapper running ruby from the repository and Gems from source I  
install gems to /usr/local/lib/site\_ruby this way…

export GEM\_HOME=/usr/local/lib/site\_ruby/1.8/gems  
ruby setup.rb config --prefix=/usr/local/  
–site-ruby/usr/local/lib/site-ruby  
ruby setup.rb setup  
ruby setup.rb install

Set necessary environment vars in /etc/environment

Add /usr/local/lib/site-ruby/1.8/gem/bin to the PATH entry  
Add GEM\_HOME="/usr/local/lib/site\_ruby/1.8/gems"

Restart so they take system wide effect

I typed that (quickly) from memory away from my ubuntu box so you may  
want to check/alter the directories a bit…
