packaging gems into a self-contained jar #131

igal-getrailo opened this Issue Dec 30, 2012 · 0 comments

1 participant

igal-getrailo commented Dec 30, 2012 edited

I'm sorry but I couldn't find a support forum so I'm asking here:

I'm trying to package compass/sass into a self-contained jar so that I can use compass without installing jruby.

I created a folder, named it jrcompass, then installed compass into it, i.e.

jruby -S gem install compass -i .

then I ran in it:

jruby -S warble

which created a file named jrcompass.jar of about ~20MB in size. so far so good.

problem is that when I try to execute the jar I get an error message (below). it seemed from the error that jruby.home was not set, so I passed it as a property in the command line and that worked, but it defeats the purpose of having a self-contained jar.

if I try to pass . as jruby.home then I get an error that it can't find rubygems

any help would be appreciated. TIA.

C:\Apps\test\jrcompass>java -jar jrcompass.jar
Gem::LoadError: Could not find compass (>= 0) amongst [rake-]
  to_specs at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:247
   to_spec at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:256
       gem at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems.rb:1231
    (root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/jrcompass/bin/compass:22
      load at org/jruby/
    (root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
   require at org/jruby/
    (root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
    (root) at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby9093955264697226808extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment