8

How can I compile a JRuby app using Warbler that isn't on the web at all? This is always what happens when I try:

$ warble
warble aborted!
No executable script found

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

I must be using this incorrectly. Anyone know how to compile JRuby app correctly?

Jwosty
  • 3,497
  • 2
  • 22
  • 50
  • Warble is intended to create a "war" file, which stands for Web Archive. It is intended for deploying web apps to a servlet container. What are you ultimately trying to accomplish? – Mark Thomas Mar 08 '12 at 23:24
  • Oh... Well, I'm using JRuby to create a game with [Slick](http://slick.cokeandcode.com/) from Ruby, and I want to be able to compile my app to a Jar file. I'm following [this tutorial](http://www.rubyinside.com/video-game-ruby-tutorial-5726.html) on how to do so, and at the end it says that you can use warbler. Anything I _can_ use? jrubyc compiles it to a .class file. – Jwosty Mar 08 '12 at 23:31
  • 1
    Evidently I'm wrong. I just checked the Warbler docs and it can also create a jar out of a plain Ruby project... something I didn't know! – Mark Thomas Mar 08 '12 at 23:39
  • Well, I guess you learn something new every day hah! – Jwosty Mar 09 '12 at 00:00
  • Ah, found out how to do this (without warbler): https://github.com/jruby/jruby/wiki/StandaloneJarsAndClasses I'm not going to accept this answer, though, because I still want to know how to use warbler. – Jwosty Mar 09 '12 at 00:07

2 Answers2

11

warble documentation implies one of two constraints:

  1. either a bin directory with the scripts and a lib directory with dependencies, or
  2. a .gemspec file with the required information to assemble the jar

I mention this because the tutorial you linked follows none of those conditions.

madth3
  • 7,275
  • 12
  • 50
  • 74
  • Hmm, I _do_ have a lib folder (with the Slick and LWJGL stuff inside), and I did see that it says a gemspec helps (I didn't know it was mandatory). I was going to create one but don't know what to put in it. Any help on this? – Jwosty Mar 09 '12 at 00:04
  • 1
    @Jwosty: just create a top-level bin/ directory and place a single script inside. Works for me... – adamlamar Dec 14 '12 at 21:16
3

Warbler can create a jar file, even though its main focus is to create a war.

In addition to warbler, take a look at the rawr gem, https://github.com/rawr/rawr If you are trying to create a standalone app that does not involve a web application server, then rawr may be simpler to use, but the commenters pointed out -- warbler does a better job at packaging dependencies and rawr does not support bundler.

Alex Blakemore
  • 11,301
  • 2
  • 26
  • 49
  • Looks like a little gem for a simple job. Interesting. – madth3 Mar 10 '12 at 18:04
  • 3
    rawr seems a lot less powerful and robust than warbler (does it automatically package gem dependencies from bundler?). Really no way to use warbler for this? Darn. – jrochkind Nov 14 '12 at 00:43
  • Rawr is a complete waste of time because it has no support for bundler. – Amala Jan 03 '14 at 17:33