# Gems installed to $HOME not recognized

**URL:** <https://www.ruby-forum.com/t/gems-installed-to-home-not-recognized/186205>\
**Category:** Ruby\
**Created:** [April 2, 2010, 3:31am UTC](https://www.ruby-forum.com/t/gems-installed-to-home-not-recognized/186205 "2010-04-02T03:31:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85f322/32.png) [@alby](https://www.ruby-forum.com/u/alby)\
**Post date:** [April 2, 2010, 3:31am UTC](https://www.ruby-forum.com/t/gems-installed-to-home-not-recognized/186205/1 "2010-04-02T03:31:33Z")

</div>

I’m using Ruby 1.9, Ubuntu (I don’t have the following problem with my  
Ruby 1.8).

For some reason, Ruby 1.9 doesn’t see gems I install to $HOME. It only  
sees gems I install as root.

In other words, if I do the following…

$ gem1.9.1 install haml

…the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and  
when I do ‘require “haml”’ ruby says there’s no such file to load.

On the other hand, when I do…

$ sudo gem1.9.1 install haml

…the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and  
doing ‘require “haml”’ works.

I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to  
~/.gem/ruby/1.9.1.

My question:

How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?

---

<div class="post-metadata">

**Author:** ![alby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85f322/32.png) [@alby](https://www.ruby-forum.com/u/alby)\
**Post date:** [April 8, 2010, 12:35am UTC](https://www.ruby-forum.com/t/gems-installed-to-home-not-recognized/186205/2 "2010-04-08T00:35:18Z")

</div>

I found that it was a lot of hassle trying to get Ruby1.9 setup on  
Ubuntu,  
particularly if you wanted to switch between 1.8 and 1.9.

Then I found rvm [http://rvm.beginrescueend.com/](http://rvm.beginrescueend.com/) which has made the whole  
process very easy to manage. I removed all my ruby packages except for  
1.8  
and gems then followed the installation instructions for rvm using the  
gem  
method.

Hope it helps you!

---

<div class="post-metadata">

**Author:** ![alby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85f322/32.png) [@alby](https://www.ruby-forum.com/u/alby)\
**Post date:** [April 13, 2010, 1:09pm UTC](https://www.ruby-forum.com/t/gems-installed-to-home-not-recognized/186205/3 "2010-04-13T13:09:42Z")

</div>

I had the same problem on Ubuntu 9.10. Setting the environment  
variable GEM\_HOME to the location of my gems seems to work.
