# Gems gone due to bad $:

**URL:** <https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449>\
**Category:** Ruby\
**Created:** [January 9, 2008, 6:56am UTC](https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449 "2008-01-09T06:56:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [January 9, 2008, 6:56am UTC](https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449/1 "2008-01-09T06:56:21Z")

</div>

On an Ubuntu box.

I have been experimenting with ruby1.9 and now I am finding that gems  
are gone from 1.8. It seems by RUBYLIB path is never modified.

I don’t know if that had anything to do with it or an update of the OS  
screwed up something.

$ ls /usr/lib/ruby/gems/1.8/  
gems/  
(all gems are listed)

$ type ruby  
ruby is /usr/bin/ruby

$ ls -l /usr/bin/ruby  
lrwxrwxrwx 1 root root 7 2007-04-23 07:58 /usr/bin/ruby -\> ruby1.8

$ type irb1.8  
/usr/bin/irb1.8

$ head -n1 /usr/bin/irb1.8  
#!/usr/bin/ruby1.8

$ /usr/bin/ruby1.8 --version  
ruby 1.8.6 (2007-06-07 patchlevel 36) [x86\_64-linux]

$ export RUBYOPT=’-w -rubygems’

$ irb1.8

irb\> $:  
=\> ["/home/gga/ruby/libs", “/home/gga/ruby/libs”, “/usr/local/lib/  
site\_ruby/1.8”, “/usr/local/lib/site\_ruby/1.8/x86\_64-linux”, “/usr/  
local/lib/site\_ruby”, “/usr/lib/ruby/1.8”, “/usr/lib/ruby/1.8/x86\_64-  
linux”, “.”]

irb\> require ‘rubygems’  
=\> false

irb\> require ‘rails’  
LoadError: no such file to load – rails

$ gem --version  
0.9.4

Can anyone help me revert back to a working rubygems?

---

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [January 10, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449/2 "2008-01-10T23:56:26Z")

</div>

gga wrote:

> (all gems are listed)  
> $ head -n1 /usr/bin/irb1.8  
> irb\> $:
> 
> $ gem --version  
> 0.9.4
> 
> Can anyone help me revert back to a working rubygems?

On my ubuntu box when installing gems using the package manager, the  
default path for gems is under /var/lib/gems

---

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [January 9, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449/3 "2008-01-09T18:34:51Z")

</div>

3.3 No such file to load – rubygems

When I run the gem command, I get the following error message:

ruby: No such file to load – rubygems (LoadError)

Whatâ€™s wrong?  
Answer

It looks like executing copy of Ruby does not have the RubyGems library  
installed. RubyGems was probably installed at one time (because the gem  
command is recognized), but it may have been installed on a different  
installation of Ruby than the one you are currently running.  
Things to check

```
* Check that the installation of Ruby that is running is the same 

```

one that has RubyGems installed. On a unix system, the which command (or  
type command) will help figure this out.

```
* Verify that the currently running installation of Ruby does indeed 

```

have the RubyGems library installed. You should find a â€œrubygems.rbâ€  
file in the site\_ruby/1.8 directory of the Ruby installation.

These mixup can easily happen after installing a new instance of Ruby,  
but the old instance preceeds the new one in the PATH list.

## [http://rubygems.org/read/chapter/19](http://rubygems.org/read/chapter/19)

Usually uninstalling all packages and installing them again (except 1.9  
pkg) fix things.

---

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [January 11, 2008, 12:01am UTC](https://www.ruby-forum.com/t/gems-gone-due-to-bad/125449/4 "2008-01-11T00:01:07Z")

</div>

On Jan 8, 2008, at 21:55 , gga wrote:

> irb\> require ‘rubygems’  
> =\> false
> 
> irb\> require ‘rails’  
> LoadError: no such file to load – rails

Expected behavior:

% gem list rails; ruby -v -e ‘require “rubygems”; require “rails”’

\*\*\* LOCAL GEMS \*\*\*

rails (1.2.6)

ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': no such file to load -- rails (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in`require’  
from -e:1
