Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Problem building a war of a new project using JRuby 1.7.0 complete jar #121

Open
marktriggs opened this Issue · 3 comments

2 participants

@marktriggs

Hi there,

I'm having a bit of trouble creating a war file for a simple Sinatra-based webapp. I'm using the jruby-complete 1.7.0 jar, and my issue seems to relate to the JRuby jar shipping with rake. This seems to prevent bundler from unpacking the rake gem, which causes Warbler to bomb out when building its .war file.

Here's my self-contained test that reproduces what I'm seeing:

 (mst@thweeble) ~$ mkdir warbler-test

 (mst@thweeble) ~$ cd warbler-test

 (mst@thweeble) ~/warbler-test$ wget http://jruby.org.s3.amazonaws.com/downloads/1.7.0/jruby-complete-1.7.0.jar                                                 --2012-11-08 15:42:26--  http://jruby.org.s3.amazonaws.com/downloads/1.7.0/jruby-complete-1.7.0.jar
 Resolving jruby.org.s3.amazonaws.com... 207.171.189.81
 Connecting to jruby.org.s3.amazonaws.com|207.171.189.81|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 18833620 (18M) [application/java-archive]
 Saving to: `jruby-complete-1.7.0.jar'

 100%[=====================================================================================================================>] 18,833,620   713K/s   in 28s

 2012-11-08 15:42:55 (661 KB/s) - `jruby-complete-1.7.0.jar' saved [18833620/18833620]


 (mst@thweeble) ~/warbler-test$ export GEM_HOME=$PWD/local_gems

 (mst@thweeble) ~/warbler-test$ java -cp 'jruby-complete-1.7.0.jar' org.jruby.Main --1.9 -S gem install bundler
 Fetching: bundler-1.2.1.gem (100%)
 Successfully installed bundler-1.2.1
 1 gem installed
 (mst@thweeble) ~/warbler-test$ cat > Gemfile
 source "http://rubygems.org"

 gem "warbler"

 (mst@thweeble) ~/warbler-test$ java -cp 'jruby-complete-1.7.0.jar' org.jruby.Main --1.9 local_gems/bin/bundle install
 Fetching gem metadata from http://rubygems.org/...
 Using rake (0.9.2.2)
 Installing jruby-jars (1.7.0)
 Installing jruby-rack (1.1.10)
 Installing rubyzip (0.9.9)
 Installing warbler (1.3.6)
 Using bundler (1.2.1)
 Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

 (mst@thweeble) ~/warbler-test$ touch config.ru                                                                   

 (mst@thweeble) ~/warbler-test$ java -cp 'jruby-complete-1.7.0.jar' org.jruby.Main --1.9 local_gems/bin/warble war
 rm -f warbler-test.war
 Creating warbler-test.war
 warble aborted!
 entry 'META-INF/jruby.home/lib/ruby/gems/shared/gems/rake-0.9.2.2/bin' not found in java.io.FileInputStream@4f50f0e2

 Tasks: TOP => war:jar
 (See full trace by running task with --trace)

Am I misunderstanding how this should work? Let me know if I can provide any further information.

Many thanks,

Mark

@marktriggs

Ah, a little more digging suggests that this might just be an issue with the trailing slash. It's looking for the string:

 'META-INF/jruby.home/lib/ruby/gems/shared/gems/rake-0.9.2.2/bin'

but the call to getName in entryInJar returns:

 'META-INF/jruby.home/lib/ruby/gems/shared/gems/rake-0.9.2.2/bin/'

Stripping off that slash before doing the comparison does the trick for me. Happy to send a pull request if that sounds right.

Thanks,

Mark

@guilleiguaran
Collaborator

@marktriggs please send a PR and I will review it :+1:

@marktriggs

Sent as #122. Thanks Guillermo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.