Why can't Ruby load .gem files directly?

Michael Schoen wrote:

- I want to try out a gem on a system where I don't have root. [...]

Yes.

How is this one done? In particular, how would I install a gem as a non-root user, and have access to both my local gems and those that are installed by root?

This is done easy, you can provide a path where the gem is put with
'gem install yourgem --install-dir /home/someone'
you have to do a

require 'rubygems'
Gem.path.push('/home/someone/yourgem/')

in your program, and voila - you've got the gem :slight_smile: (this works as well
with multiple directories and whatnot else - check the 'gem install
help')

i like the gems very much, they are just the kind of unification i
wanted for libraries in ruby, they are an esay way to distribute your
libraries, let everyone know it exists and provides fast/simple ways
for install/uninstall that can be automated in high grades.
everyone who insists on it, can still install the libraries manually,
but i don't want to be forced to do it. I like gems as being a simple
layer that cares about libraries in ruby and very much unifies the
code, making it even more readable and provides common ways of
dependencies...
but i wouldn't mind if the gems would take the step from debian-like
simple installing to gentoo-like local compiling.

so long...
manveru

This is done easy, you can provide a path where the gem is
put with 'gem install yourgem --install-dir /home/someone'

you have to do a

require 'rubygems'
Gem.path.push('/home/someone/yourgem/')

Now your application is restricted to your machine or one of
its clones...

gegroet,
Erik V. - http://www.erikveen.dds.nl/