On Fri, Oct 23, 2009 at 5:44 PM, Chad Woolley <
thewoolleyman@...> wrote:
> Hello,
>
> We found this thread [1], but we have the opposite request. In our
> WAR, GEM_HOME seems to always be set to the system gem home. We don't
> want this, because we don't want any system gems to pollute our load
> path when we deploy our war to customers.
>
> We've tried:
> * setting ENV['GEM_HOME'] to nil in config/preinitializer.rb - but
> then the rails environment won't even start
> * setting config.webxml.GEM_HOME='' and config.webxml.gem.home='' in
> warble.rb - this set the properties in web.xml, but they had no effect
> on GEM_HOME or Gem.dir.
>
> Gem.path is correctly set to the to the path of WEB-INF/gems under glassfish.
>
> Questions:
> * How can we make use WEB-INF/gems under glassfish as our GEM_HOME?
> * What is setting Gem.path correctly to WEB-INF/gems under glassfish?
> Warbler? Glassfish? Something else?
I'll address the second question first, since it will help answer the
first one. JRuby-Rack, the Java shim library included with Warbler,
responsible for booting Rails in the Java container, is the one
setting up GEM_PATH. It sets it fairly early in the startup process,
before the Rails initializer is loaded, so I'm pretty sure the
following in config/environment.rb or config/preinitializer.rb should
work:
ENV["GEM_HOME"] = ENV["GEM_PATH"]
/Nick
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email