Forum: JRuby How to set GEM_PATH in warbler?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cceff61fcb5a007a45e90b37c246cb38?d=identicon&s=25 jmurillo (Guest)
on 2009-02-13 15:50
(Received via mailing list)
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-warbl...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-13 16:59
(Received via mailing list)
On Fri, Feb 13, 2009 at 8:50 AM, jmurillo <jmurillo@jonima.com.mx>
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:

  <context-param>
    <param-name>gem.path</param-name>
    <param-value>C:/jruby/lib/ruby/gems/1.8</param-value>
  </context-param>


/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Cceff61fcb5a007a45e90b37c246cb38?d=identicon&s=25 jmurillo (Guest)
on 2009-02-13 17:51
(Received via mailing list)
Thanks for the quick response.

The web.xml has exactly the lines you mentioned.
  <context-param>
    <param-name>gem.path</param-name>
    <param-value>C:/jruby/lib/ruby/gems/1.8</param-value>
  </context-param>

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-warbl...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-13 21:18
(Received via mailing list)
On Fri, Feb 13, 2009 at 10:50 AM, jmurillo <jmurillo@jonima.com.mx>
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
Cceff61fcb5a007a45e90b37c246cb38?d=identicon&s=25 jmurillo (Guest)
on 2009-02-14 15:55
(Received via mailing list)
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-warbl...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.