[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Change Gempath at Runtime

Michael Boutros

1/29/2009 1:33:00 AM

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 Boutros
--
Posted via http://www.ruby-....

1 Answer

Eric Hodel

1/29/2009 1:36:00 AM

0

On Jan 28, 2009, at 17:33 PM, Michael Boutros wrote:
> 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.

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

> RubyGems' default local repository can be overriden with the
> GEM_PATH and
> GEM_HOME environment variables. GEM_HOME sets the default
> repository to
> install into. GEM_PATH allows multiple local repositories to be
> searched
> for gems.