Eric Hodel
6/30/2008 10:15:00 PM
On Jun 30, 2008, at 13:06 PM, Suraj Kurapati wrote:
> Is it possible to use gem files without having to install them, like
> you
> can with jar files in Java?
No.
> For instance, I have a gem/ directory containing various gems, and I
> would like to add gem/ to the load path and simply require() the gem
> by
> name:
>
> # add gem/ to load path
> $: << File.join(File.dirname(__FILE__), 'gem')
>
> # use the 'foo' gem
> require 'foo' # loads gem/foo-1.0.0.gem/lib/foo.rb
Instead you can do:
gem install -i ~/tmp/gems foo
GEM_HOME=~/tmp/gems ruby my_foo_using_program.rb
rm -r ~/tmp/gems
> If gem files in the load path can be treated as a virtual file system
> (VFS) then this should be possible, no?
Somebody would need to write that code, but it would only work for
gems without extensions to be compiled, and would not generate useful
documentation.