# Trouble with gems on Ubuntu

**URL:** <https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111>\
**Category:** Rails\
**Created:** [May 9, 2008, 1:23am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111 "2008-05-09T01:23:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![taro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@taro](https://www.ruby-forum.com/u/taro)\
**Post date:** [May 9, 2008, 1:23am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111/1 "2008-05-09T01:23:20Z")

</div>

## I’m trying to install rails in my laptop, ubuntu partition, but gems won’t work. This is what it says:

## $ sudo gem update --system /usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)

Obviously, the error exists here:

* * *

#! /usr/bin/ruby1.8  
#–

# Copyright 2006 by Chad F., Rich Kilmer, Jim W. and others.

# All rights reserved.

# See LICENSE.txt for permissions.

#++

require ‘rubygems’  
Gem.manage\_gems

required\_version = Gem::Version::Requirement.new("\>= 1.8.0")  
unless required\_version.satisfied\_by?(Gem::Version.new(RUBY\_VERSION))  
puts “Expected Ruby Version #{required\_version}, was  
#{RUBY\_VERSION}”  
exit(1)  
end

# We need to preserve the original ARGV to use for passing gem options

# to source gems. If there is a – in the line, strip all options

after

# it…its for the source building process.

args = !ARGV.include?("–") ? ARGV.clone : ARGV[0…ARGV.index("–")]

## Gem::GemRunner.new.run(args) #ERROR HERE!!!

What can I do to fix this?

---

<div class="post-metadata">

**Author:** ![taro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@taro](https://www.ruby-forum.com/u/taro)\
**Post date:** [May 9, 2008, 1:28am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111/2 "2008-05-09T01:28:01Z")

</div>

did you use apt-get ?

---

<div class="post-metadata">

**Author:** ![taro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@taro](https://www.ruby-forum.com/u/taro)\
**Post date:** [May 9, 2008, 1:30am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111/3 "2008-05-09T01:30:56Z")

</div>

No. I used the directions here (note, I used rubygems-1.1.1.tgz  
instead):  
[https://help.ubuntu.com/community/RubyOnRails](https://help.ubuntu.com/community/RubyOnRails)

---

<div class="post-metadata">

**Author:** ![taro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@taro](https://www.ruby-forum.com/u/taro)\
**Post date:** [May 9, 2008, 4:55am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111/4 "2008-05-09T04:55:12Z")

</div>

Stick with Ubuntu rubygems and spare yourself the headaches. It works  
fine even at 0.9.4.

– Long  
[http://FATdrive.tv/wall/trakb/10-Long](http://FATdrive.tv/wall/trakb/10-Long)  
[http://FATdrive.tv/](http://FATdrive.tv/) - store, play, share

----- Original Message -----  
Taro wrote:

No. I used the directions here (note, I used rubygems-1.1.1.tgz  
instead):  
[https://help.ubuntu.com/community/RubyOnRails](https://help.ubuntu.com/community/RubyOnRails)

On May 8, 7:27 pm, glasswing28 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> did you use apt-get ?
> 
> On May 8, 4:22 pm, Taro [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m trying to install rails in my laptop, ubuntu partition, but  
> > gems  
> > #–
> > 
> > # Copyright 2006 by Chad F., Rich Kilmer, Jim W. and

others.

> > # All rights reserved.
> > 
> > # See LICENSE.txt for permissions.
> > 
> > #++
> 
> > require ‘rubygems’  
> > Gem.manage\_gems
> 
> > required\_version = Gem::Version::Requirement.new(“\>= 1.8.0”)  
> > unless  
> > required\_version.satisfied\_by?(Gem::Version.new(RUBY\_VERSION))  
> > puts “Expected Ruby Version #{required\_version}, was  
> > #{RUBY\_VERSION}”  
> > exit(1)  
> > end
> 
> > # We need to preserve the original ARGV to use for passing gem

options

> > # to source gems. If there is a – in the line, strip all options
> > 
> > after
> > 
> > # it…its for the source building process.
> > 
> > args = !ARGV.include?(“–”) ? ARGV.clone :  
> > ARGV[0…ARGV.index(“–”)]

---

<div class="post-metadata">

**Author:** ![taro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@taro](https://www.ruby-forum.com/u/taro)\
**Post date:** [May 9, 2008, 4:47am UTC](https://www.ruby-forum.com/t/trouble-with-gems-on-ubuntu/137111/5 "2008-05-09T04:47:58Z")

</div>

Taro wrote:

> What can I do to fix this?

In usr/bin/gem add

require ‘rubygems/gem\_runner’

right after the

require ‘rubygems’

statement.
