# Rubygems - uninitialized constant

**URL:** <https://www.ruby-forum.com/t/rubygems-uninitialized-constant/143426>\
**Category:** Ruby\
**Created:** [July 18, 2008, 11:59am UTC](https://www.ruby-forum.com/t/rubygems-uninitialized-constant/143426 "2008-07-18T11:59:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbcox23](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Post date:** [July 18, 2008, 11:59am UTC](https://www.ruby-forum.com/t/rubygems-uninitialized-constant/143426/1 "2008-07-18T11:59:15Z")

</div>

With a fresh install of Rubygems, when I issue a “gem -h” command, the  
result is:

/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)

Background:

With a fresh installation of Kubuntu 8.04.1 Linux, I installed ruby 1.8  
with “apt-get…”, and then installed rubygems 1.8 from the tar file at  
rubyforge. There were problems, so I figured the rubygems install done  
that way was a bad idea. Basically, I was getting an odd message when  
trying to install the webby gem. Three other gems did install without  
error, including sequel.

So, I reinstalled ruby 1.8, and rubygems from the Adept package manager,  
at which point I got the unexpected problem above.

I don’t know what’s wrong or how to get a good install of rubygems, at  
this point. All suggests greatly appreciated.

Thanks,

Tom

---

<div class="post-metadata">

**Author:** ![tbcox23](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Post date:** [July 18, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/rubygems-uninitialized-constant/143426/2 "2008-07-18T12:20:20Z")

</div>

Tom C. wrote:

> that way was a bad idea. Basically, I was getting an odd message when
> 
> Tom

Thanks to a kind soul on the Webby list (there’s NEVER anyone there this  
time of night - but Doug L. was, tonight - tks Doug!) I now have  
the fix on this -

[http://ericbeland.com/2007/12/20/uninitialized-constant-gem-gemrunner](http://ericbeland.com/2007/12/20/uninitialized-constant-gem-gemrunner)

/usr/bin/gem simply needs the following line inserted into it.

require ‘rubygems/gem\_runner’

Now things work.

I hope this gets fix by someone, if such a response is needed.  
Apparently its happened to other people.

t.

–

```auto
Tom C., MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< removed_email_address@domain.invalid >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)

```

---

<div class="post-metadata">

**Author:** ![tbcox23](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Post date:** [July 23, 2008, 8:12am UTC](https://www.ruby-forum.com/t/rubygems-uninitialized-constant/143426/3 "2008-07-23T08:12:18Z")

</div>

On Jul 18, 2008, at 03:14 AM, Tom C. wrote:

> > did install without error, including sequel.
> 
> [http://ericbeland.com/2007/12/20/uninitialized-constant-gem-gemrunner](http://ericbeland.com/2007/12/20/uninitialized-constant-gem-gemrunner)
> 
> /usr/bin/gem simply needs the following line inserted into it.
> 
> require ‘rubygems/gem\_runner’
> 
> Now things work.
> 
> I hope this gets fix by someone, if such a response is needed.  
> Apparently its happened to other people.

No, this is wrong.

You have an old `gem` lying around. Recent RubyGems releases install  
gem to match your ruby binary’s name, which is usually symlinked from  
something like `ruby1.8` to `ruby` (thus, `gem1.8`). Delete `gem` and  
symlink it appropriately. When you installed RubyGems the last thing  
it printed was where it installed the gem executable.
