# Installing gems for a single user

**URL:** <https://www.ruby-forum.com/t/installing-gems-for-a-single-user/98290>\
**Category:** Ruby\
**Created:** [July 13, 2006, 5:44pm UTC](https://www.ruby-forum.com/t/installing-gems-for-a-single-user/98290 "2006-07-13T17:44:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [July 13, 2006, 5:44pm UTC](https://www.ruby-forum.com/t/installing-gems-for-a-single-user/98290/1 "2006-07-13T17:44:09Z")

</div>

I’m used to using gems locally where I can install them systemwide. But  
in a shared hosting environment, where there might be several systemwide  
gems installed by the host, there may be gems I want to install just in  
my home directory. Does RubyGems support this? In a way that your Ruby  
program can access both the systemwide and local gems?

Thanks!

Jen

---

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [July 13, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/installing-gems-for-a-single-user/98290/2 "2006-07-13T20:16:22Z")

</div>

On Fri, Jul 14, 2006 at 12:43:03AM +0900, jennyw wrote:

> I’m used to using gems locally where I can install them systemwide. But  
> in a shared hosting environment, where there might be several systemwide  
> gems installed by the host, there may be gems I want to install just in  
> my home directory. Does RubyGems support this? In a way that your Ruby  
> program can access both the systemwide and local gems?

Sure:

mkdir ~/.gems  
export GEM\_HOME=/home/jennyw/.gems  
wget [http://code.whytheluckystiff.net/sources/rubyforge-0.0.1.gem](http://code.whytheluckystiff.net/sources/rubyforge-0.0.1.gem)  
gem install rubyforge-0.0.1.gem

And you should be able to `gem list`, `gem install`, etc.

In scripts where you don’t have control over the environment and  
RubyGems is  
already loaded, use:

Gem.use\_paths(“/home/jennyw/.gems”)

For other concrete examples, you might scan:  
[http://balloon.hobix.com/lib/balloon.rb](http://balloon.hobix.com/lib/balloon.rb)

\_why

---

<div class="post-metadata">

**Author:** ![jennyw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7feea3/32.png) [@jennyw](https://www.ruby-forum.com/u/jennyw)\
**Post date:** [July 14, 2006, 4:06am UTC](https://www.ruby-forum.com/t/installing-gems-for-a-single-user/98290/3 "2006-07-14T04:06:51Z")

</div>

jennyw wrote:

> I’m used to using gems locally where I can install them systemwide. But  
> in a shared hosting environment, where there might be several systemwide  
> gems installed by the host, there may be gems I want to install just in  
> my home directory. Does RubyGems support this? In a way that your Ruby  
> program can access both the systemwide and local gems?

My solution: compile and install Ruby in ~/software (or similar) and  
use _that_ Ruby for everything, including gems. No permission  
problems.

Gavin
