On 4/30/07, fkc_email-news @ yahoo dot com <fkchang2000 / gmail.com> wrote:
> Hi All:
>   I've convinced the java project to allow ruby (yay!), and now we
> want to include and control the ruby dist, libraries and gems and all
> in svn.  Since the project can be checked out anywhere I want to be
> able to relocate ruby.  I tried allinoneruby (happily used ruby2exe on
> a different project), and can't figure out how to get it to include
> all the libs and gems.  I also tried to point $: at the correct
> locations, but got an unresolved lib.

What was your error?  A quick test seems to indicate that hijacking $:
works:

> /opt/bin/ruby -e 'puts $:; require "rubygems"'
/opt/lib/ruby/site_ruby/1.8
/opt/lib/ruby/site_ruby/1.8/i686-linux
/opt/lib/ruby/site_ruby
/opt/lib/ruby/1.8
/opt/lib/ruby/1.8/i686-linux
.
> mv /opt /tmp/
> /tmp/opt/bin/ruby -e 'puts $:; require "rubygems"'
/opt/lib/ruby/site_ruby/1.8
/opt/lib/ruby/site_ruby/1.8/i686-linux
/opt/lib/ruby/site_ruby
/opt/lib/ruby/1.8
/opt/lib/ruby/1.8/i686-linux
.
-e:1:in `require': no such file to load -- rubygems (LoadError)
        from -e:1
> /tmp/opt/bin/ruby -e '$:.map{|d|d.gsub!(/^/, "/tmp")}; puts $:; require "rubygems"'
/tmp/opt/lib/ruby/site_ruby/1.8
/tmp/opt/lib/ruby/site_ruby/1.8/i686-linux
/tmp/opt/lib/ruby/site_ruby
/tmp/opt/lib/ruby/1.8
/tmp/opt/lib/ruby/1.8/i686-linux
.