# Change Gempath at Runtime

**URL:** <https://www.ruby-forum.com/t/change-gempath-at-runtime/158887>\
**Category:** Ruby\
**Created:** [January 29, 2009, 2:35am UTC](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887 "2009-01-29T02:35:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Post date:** [January 29, 2009, 2:35am UTC](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887/1 "2009-01-29T02:35:41Z")

</div>

Hello,

I have a problem with my host. I have several gems installed through  
cPanel and even directly using the ‘gem’ command, but my Ruby scripts  
can not locate them because apparently the Gem path is not correctly  
set. Is there any way to tell Ruby where to look for gems during  
runtime?

I tried to unpack each gem and require it separately, but the gems are  
not built for this, since it throw a file not found error if a gem, say  
Nokogiri, tries to do “require ‘nokogiri/xml’”.

Any other possible solutions would be greatly appreciated.

Thanks,  
Michael B.

---

<div class="post-metadata">

**Author:** ![michaelb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Post date:** [January 29, 2009, 2:39am UTC](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887/2 "2009-01-29T02:39:20Z")

</div>

On Jan 28, 2009, at 17:33 PM, Michael B. wrote:

> Any other possible solutions would be greatly appreciated.

This information can be found in `gem help environment`:

---

<div class="post-metadata">

**Author:** ![michaelb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Post date:** [January 29, 2009, 2:57am UTC](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887/3 "2009-01-29T02:57:44Z")

</div>

Eric,

It looks like the gems are being looked for in the right place, but are  
not being found. Output posted to [54320’s gists · GitHub](http://gist.github.com/54320) for the  
sake of readability.
