# Rubygems problem on Mac OS X, please help

**URL:** <https://www.ruby-forum.com/t/rubygems-problem-on-mac-os-x-please-help/105303>\
**Category:** Ruby\
**Created:** [May 28, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/rubygems-problem-on-mac-os-x-please-help/105303 "2007-05-28T18:00:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_von\_Laudermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e79b87/32.png) [@Karl\_von\_Laudermann](https://www.ruby-forum.com/u/Karl_von_Laudermann)\
**Post date:** [May 28, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/rubygems-problem-on-mac-os-x-please-help/105303/1 "2007-05-28T18:00:41Z")

</div>

I finally got around to installing the latest Ruby version onto my Mac  
instead of using the one that comes with Mac OS X. I followed the  
instructions here:

[http://maczealots.com/tutorials/rubyosa/](http://maczealots.com/tutorials/rubyosa/)

Doing so, I installed readline 5.2, then built and installed Ruby  
1.8.6, then installed rubygems 0.9.3. (Notice that in the link above  
it says to install readline 5.1 and rubygems 0.9.2, but I just  
downloaded the latest versions at the time.

Everything seems to work fine, except rubygems. Whenever I issue a  
command, I get an error about an uninitialized constant. E.g.:

> gem list -r

\*\*\* REMOTE GEMS \*\*\*  
ERROR: While executing gem … (NameError)  
uninitialized constant Gem::SourceInfoCache

> gem install rubyosa  
> ERROR: While executing gem … (NameError)  
> uninitialized constant Gem::RemoteInstaller

Can somebody help me?

Before you ask, yes I installed everything into /usr/local, and yes I  
made sure /usr/local/bin is first in my path. Doing “which ruby” and  
“ruby -v” both confirm that I am running ruby 1.8.6 from /usr/local/  
bin. Are there any other environment variables I need to set to enable  
rubygems?

---

<div class="post-metadata">

**Author:** ![Karl\_von\_Laudermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e79b87/32.png) [@Karl\_von\_Laudermann](https://www.ruby-forum.com/u/Karl_von_Laudermann)\
**Post date:** [May 29, 2007, 12:30am UTC](https://www.ruby-forum.com/t/rubygems-problem-on-mac-os-x-please-help/105303/2 "2007-05-29T00:30:25Z")

</div>

On May 28, 12:24 pm, Jim W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Gem::RemoteInstaller # makes sure the class was loaded  
> $:.find { |d| File.exist? File.join(d,  
> ‘rubygems/remote\_installer.rb’) }  
> # Finds the location of the  
> require file
> 
> The last command should show the location of the file containing the  
> RemoteInstaller class. Open the file and make sure it contains a proper  
> definition for RemoteInstaller.

Thank you! That was the problem: for some reason, the file  
remote\_installer.rb was present, but empty (zero bytes in size). But  
there was also a file called remote\_installer.1.rb that had the  
correct contents. Likewise, source\_info\_cache.rb was empty, and its  
contents were in source\_info\_cache.1.rb. I have no idea why this  
happened, and all the other files seem fine. Fixing this solved the  
problem.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Karl\_von\_Laudermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e79b87/32.png) [@Karl\_von\_Laudermann](https://www.ruby-forum.com/u/Karl_von_Laudermann)\
**Post date:** [May 28, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/rubygems-problem-on-mac-os-x-please-help/105303/3 "2007-05-28T18:24:47Z")

</div>

Karl von Laudermann wrote:

> Everything seems to work fine, except rubygems. Whenever I issue a  
> command, I get an error about an uninitialized constant. E.g.:
> 
> > gem list -r
> 
> \*\*\* REMOTE GEMS \*\*\*  
> ERROR: While executing gem … (NameError)  
> uninitialized constant Gem::SourceInfoCache
> 
> > gem install rubyosa  
> > ERROR: While executing gem … (NameError)  
> > uninitialized constant Gem::RemoteInstaller
> 
> Can somebody help me?

Odd, RubyGems isn’t finding some of its own libraries. If the files  
were missing, I would have expected an error on the require. Instead it  
looks as if the files are found, but the contents are not there.  
Interesting.

Try the following commands in irb:

require ‘rubygems/remote\_installer’ # makes sure the file can be  
found  
Gem::RemoteInstaller # makes sure the class was loaded  
$:.find { |d| File.exist? File.join(d,  
‘rubygems/remote\_installer.rb’) }  
# Finds the location of the  
require file

The last command should show the location of the file containing the  
RemoteInstaller class. Open the file and make sure it contains a proper  
definition for RemoteInstaller.

–  
– Jim W.
