Issue with the gems using jruby-complete

Hi all,
I’ve got another problem with the rubygems which I want to use
jruby-complete.jar

I have the jruby-complete.jar file which has rails, active record jdbc
adapter with h2 adapter inside the jar.

I have this simple test program

$LOAD_PATH << ‘META-INF/jruby.home/lib/ruby/site_ruby/1.8’

require ‘rubygems’
require ‘mongrel’
require ‘activerecord’
gem ‘activerecord-jdbc-adapter’ # ERROR THIS LINE
gem ‘activerecord-jdbch2-adapter’

When I look inside the jar file (the META-INF/…) I can see all the
required directories there.

I appreciate your comment to resolve this issue.

Cheers,

-A


Ali S., Research Assistant, LSIR - Distributed Information Systems
Laboratory
EPFL-IC-IIF-LSIR, Bâtiment BC, Station 14, CH-1015 Lausanne, Switzerland.
http://lsirpeople.epfl.ch/salehi/
email: [email protected]
Tel: +41-21-693.6656/7563 Mobile: +41-21-78.815.2020 Fax:
+41-21-693.8115


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, Jul 30, 2008 at 10:27 AM, Ali S. [email protected] wrote:

require ‘rubygems’
require ‘mongrel’
require ‘activerecord’
gem ‘activerecord-jdbc-adapter’ # ERROR THIS LINE
gem ‘activerecord-jdbch2-adapter’

When I look inside the jar file (the META-INF/…) I can see all the
required directories there.

Hi Ali, unfortunately Rubygems expects the gem directory structure to
be on the filesystem ($GEM_HOME/gems, $GEM_HOME/specifications etc.),
and in JRuby we don’t yet have a virtual filesystem abstraction that
lets you do something like
File.open("jar:file:///path/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8).

If you want to bundle gems inside of the complete jar, your best bet
is to not use Rubygems at all, but just bundle the code either inside
the root of the jar, or in a subdirectory in the jar that you can add
to the load path like you did for site_ruby/1.8.

Cheers,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs