On Sunday 02 October 2005 01:11 pm, Joshua Haberman wrote:
> On Oct 1, 2005, at 8:59 PM, Jim Weirich wrote:
> > On Saturday 01 October 2005 11:12 pm, Joshua Haberman wrote:
> >> [...] For example, can gems support these use cases?
[... yes to all use cases ...]
> How?

Ok, I was lazy with my responces.  Here's the details.

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

http://docs.rubygems.org/read/chapter/10#page33 -- See the --install-dir 
option.

> >> - I want to have more than one local gem repository [...]

http://docs.rubygems.org/read/chapter/12 -- See the GEM_PATH and GEM_HOME 
environment options.  Also see http://docs.rubygems.org/read/chapter/11 for 
config file variations.

> >> - I want to install a gem from a gemfile I already have [...]

http://docs.rubygems.org/read/chapter/10#page33 -- see --local option.

> >> - I want to "unpack" a gem into a directory structure that can be
> >> deployed to another machine, without having to run "gem" on the
> >> remote machine

http://docs.rubygems.org/read/chapter/10#page39 -- The "unpack" command.  Copy 
the resulting directory to whereever you want on any machine and (a) run the 
packages native install/setup scripts or (b) arrange for the proper 
directories to be included in the LOAD_PATH when ruby is run.  You can 
determine the "proper directories" by examining the gemspec for that gem (see 
http://docs.rubygems.org/read/chapter/10#page37 on how to extract the gem 
spec).

If you don't want to install the gem first (unpack works on installed gems), 
you can just untar the gem file and then untar the data embedded there

Sorry, there's more manual steps in this one, but the information is there and 
is public.  If you don't want to do all these steps by hand, we do include a 
script that does it for you (see http://docs.rubygems.org/read/book/2).

> >> - same as the previous one, but I also want to "unpack" the gem into
> >> a different directory root [...]

Same answer as above, note the "whereever you want" in the answer.

-- 
-- Jim Weirich    jim / weirichhouse.org     http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct, 
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)