# Ubygems.rb hack

**URL:** <https://www.ruby-forum.com/t/ubygems-rb-hack/167581>\
**Category:** Rails\
**Created:** [May 9, 2009, 5:19pm UTC](https://www.ruby-forum.com/t/ubygems-rb-hack/167581 "2009-05-09T17:19:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 9, 2009, 5:19pm UTC](https://www.ruby-forum.com/t/ubygems-rb-hack/167581/1 "2009-05-09T17:19:18Z")

</div>

I just updated my Ubuntu Hardy Heron (8.04) to Ruby 1.8.7 and Rails  
2.3.2, and I’ve managed to get stuck with

```
                      ruby: no such file to load -- ubygems

```

(LoadError)

Investigating further, it appears that this is a hack someone added  
‘long time ago’ to allow

```
                      ruby -rubygems blah

```

to work. Before I did the upgrade, there was a file in there named  
ubygems.rb which only had a “require ‘rubygems’” line in it.

Most of the commentary on this subject revolved around Doze or  
Cygwin, and the recommendation was to unset $RUBYOPT

I did so, and now it says RubyGems is not installed. Setting it again  
returns me to the ubygems error.

What’s the right way to fix this? I had already updated rubygems to  
1.3.3, so

```
                    sudo gem update --system

```

does not fix it.

I could easily recreate the hack by installing a file ubygems.rb,  
but… blyecch!

Thanks in advance!

– Don W.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 9, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/ubygems-rb-hack/167581/2 "2009-05-09T18:15:34Z")

</div>

On May 9, 8:42 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1.3.3, so
> 
> ```
> sudo gem update --system
> 
> ```
> 
> does not fix it.
> 
> I could easily recreate the hack by installing a file ubygems.rb,  
> but… blyecch!

UPDATE: It appears that it is Ruby that is having the issue with the  
hack. I called the old 1.8.6-p111 ruby that was the previous standard  
install (thankfully, I’d renamed rather than overwriting!), and it  
works. I’d still like to know the proper way to fix it, but I can limp  
along with this.

There is a ubygems.rb file in /usr/lib/ruby/1.8, as well as one in the  
gem directory for rubygems-1.3.3. :-\
