How to set GEM_PATH in warbler?


#1

Is it possible to set a different GEM_PATH for a .war created in warble?

I want to share the gems directory among many applications on the same
server.

I have tried many options and none worked

  • in warble.rb putting: config.webxml.gem.path =
    “C:/jruby/lib/ruby/gems/1.8”

  • changing the environment variable GEM_PATH

  • changing the java parameter for the command that starts jboss with
    set JAVA_OPTS=%JAVA_OPTS% -Dgem.path=“C:/jruby/lib/ruby/gems/1.8”

In all the cases, if I display Gem.path it always shows this:
[“C:/jboss-4.0.5.GA/server/default/./tmp/deploy/tmp12822joninv-exp.war/WEB-INF/gems”,

“file:/C:/jboss-4.0.5.GA/server/default/lib/jruby-complete-1.1.6.jar!/META-INF/jruby.home/lib/ruby/gems/1.8”]

Thanks for your help

View this message in context:
http://www.nabble.com/How-to-set-GEM_PATH-in-warbler--tp21997785p21997785.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

On Fri, Feb 13, 2009 at 8:50 AM, jmurillo removed_email_address@domain.invalid
wrote:

Is it possible to set a different GEM_PATH for a .war created in warble?

I want to share the gems directory among many applications on the same
server.

I have tried many options and none worked

  • in warble.rb putting: config.webxml.gem.path =
    “C:/jruby/lib/ruby/gems/1.8”

This should work. Can you check and make sure that there’s a context
parameter in tmp/war/WEB-INF/web.xml that looks like:

gem.path C:/jruby/lib/ruby/gems/1.8

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

Thanks for the quick response.

The web.xml has exactly the lines you mentioned.

gem.path
C:/jruby/lib/ruby/gems/1.8

It is the same path I get with: jruby -S gem environment

I added this line to the warbler.rb so that no gems are included on the
war.
config.gems = []

and effectively no gems are included.

but when the jboss server starts it prints this:

10:42:45,281 ERROR [STDERR] Missing the Rails 2.1.2 gem. Please gem install -v= 2.1.2 rails, update your RAILS_GEM_VERSION setting in
config/environment.rb
for
the Rails version you do have installed, or comment out
RAILS_GEM_VERSION
to us
e the latest version installed.
10:42:45,296 ERROR [STDERR] Missing the Rails 2.1.2 gem. Please gem install -v= 2.1.2 rails, update your RAILS_GEM_VERSION setting in
config/environment.rb
for
the Rails version you do have installed, or comment out
RAILS_GEM_VERSION
to us
e the latest version installed.
10:42:45,296 ERROR [[/joninv]] Error: unable to initialize application
org.jruby.rack.RackInitializationException: exit
from
C:\jboss-4.0.5.GA\server\default.\tmp\deploy\tmp43482joninv-exp.wa
r\WEB-INF/config/boot.rb:38:in `run’

I have this line in environment.rb
RAILS_GEM_VERSION = ‘2.1.2’ unless defined? RAILS_GEM_VERSION

When I run the application from the mongrel server in Netbeans, it runs
ok,


View this message in context:
http://www.nabble.com/How-to-set-GEM_PATH-in-warbler--tp21997785p22000347.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

Thank you.

I separated the gems in another directory, and modified GEM_PATH
pointing to
it, and everything works: script/console , mongrel and JBoss.


View this message in context:
http://www.nabble.com/How-to-set-GEM_PATH-in-warbler--tp21997785p22013408.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#5

On Fri, Feb 13, 2009 at 10:50 AM, jmurillo removed_email_address@domain.invalid
wrote:

I added this line to the warbler.rb so that no gems are included on the war.
config.gems = []

and effectively no gems are included.

but when the jboss server starts it prints this:

10:42:45,281 ERROR [STDERR] Missing the Rails 2.1.2 gem. Please `gem install

I assume that Rails 2.1.2 is installed in your gem path? I can’t
really think of anything else that would be the problem. You can set
GEM_PATH in the environment and start up your rails application with
mongrel or webrick?

/Nick

the Rails version you do have installed, or comment out RAILS_GEM_VERSION
RAILS_GEM_VERSION = ‘2.1.2’ unless defined? RAILS_GEM_VERSION

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email