[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Installing gems for a single user

jennyw

7/13/2006 3:43:00 PM

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




2 Answers

why the lucky stiff

7/13/2006 6:15:00 PM

0

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...
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/ball...

_why

Gavin Sinclair

7/14/2006 2:01:00 AM

0

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