Forum: JRuby Warbler-built code containing certain JRuby gems doesn't appear to work

5d0c55e6323450d8a19daab4a456af4f?d=identicon&s=25 Farsheed Bamboat (angeloflight)
on 2012-02-02 21:14
I noticed that some of my more basic code built with warbler executed
just fine, while other programs simply didn't work. After a bit of trial
and error and playing with the code, this is what I discovered:

The following code works fine when built with warbler:
__________________
require 'rubygems'

puts "Hello World"
gets
___________________


However, if I add ANY of the following ruby gems to the above code and
build it with warbler, I am unable to run the resulting JAR file or the
subsequently converted EXE file.
__________________________
spreadsheet
ole/storage
jruby-win32ole
__________________________

Has anyone else here ever faced this issue and does anyone know whether
there is a workaround or a solution for this?
5d0c55e6323450d8a19daab4a456af4f?d=identicon&s=25 Farsheed Bamboat (angeloflight)
on 2012-02-17 17:56
Just bumping this thread in case anyone knows the solution to this.
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2012-02-17 19:48
(Received via mailing list)
On Thu, Feb 2, 2012 at 2:14 PM, Farsheed Bamboat <lists@ruby-forum.com>
wrote:
> ___________________
>
> Has anyone else here ever faced this issue and does anyone know whether
> there is a workaround or a solution for this?

Can you post versions of Warbler, JRuby, etc. and also post the output
of "jar tf mywar.war"?

/Nick
5d0c55e6323450d8a19daab4a456af4f?d=identicon&s=25 Farsheed Bamboat (angeloflight)
on 2012-02-23 20:02
Attachment: ExcelRubyPractice.jar (10 MB)
Nick Sieger wrote in post #1047451:
>
> Can you post versions of Warbler, JRuby, etc. and also post the output
> of "jar tf mywar.war"?
>
> /Nick


Warbler Version: 1.3.2
JRuby Version: 1.5.1

I'm not sure what you mean by [post the output of "jar tf mywar.war"].
I've attached the JAR file created by warbler along with this post for
your reference if that helps.
2c0c4cf3ccc8da22f7c3b9586ce1cd70?d=identicon&s=25 Christian MICHON (Guest)
on 2012-02-23 20:15
(Received via mailing list)
On Thu, Feb 23, 2012 at 8:02 PM, Farsheed Bamboat <lists@ruby-forum.com>
wrote:
>
> I'm not sure what you mean by [post the output of "jar tf mywar.war"].
> I've attached the JAR file created by warbler along with this post for
> your reference if that helps.
>
> Attachments:
> http://www.ruby-forum.com/attachment/7093/ExcelRub...
>
>

the gem spreadsheet for example is not inside your jar file.

2 possible solutions:
- tell warbler to include them (look at the man page, I believe it's
possible)
- include gems and specifications inside the jar file itself: you need
to create gems and specifications folders on top, and put inside
respective folders from your gems and specs. This is what I usually
do.

--
Christian
5d0c55e6323450d8a19daab4a456af4f?d=identicon&s=25 Farsheed Bamboat (angeloflight)
on 2012-02-24 23:38
Christian MICHON wrote in post #1048510:

> the gem spreadsheet for example is not inside your jar file.
>
> 2 possible solutions:
> - tell warbler to include them (look at the man page, I believe it's
> possible)
> - include gems and specifications inside the jar file itself: you need
> to create gems and specifications folders on top, and put inside
> respective folders from your gems and specs. This is what I usually
> do.
>
> --
> Christian

Thanks for the solutions, although I'm a complete programming noob and
can't seem to figure out how to implement them. Do I need to copy-paste
the gems somewhere? If so, how?

I looked online and found the following code:
________________________________
source "http://gems.github.com"
gem "spreadsheet"
--------------------------------

Do I need to add this somewhere, say, in the spec folder? If so, what
should I name the file in that folder and is there anything else to be
done?
7859fbeff5e6311747828f7c0f1d7eb6?d=identicon&s=25 Zijad Purkovic (Guest)
on 2012-02-24 23:45
(Received via mailing list)
You can try with something like this in your warble.rb file:

config.gems["actionpack"] = "2.3.8"

Obviously, change the gem and version to match your gem.

On Fri, Feb 24, 2012 at 11:38 PM, Farsheed Bamboat
<lists@ruby-forum.com> wrote:
>> do.
> source "http://gems.github.com"
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>  http://xircles.codehaus.org/manage_email
>
>



--
Zijad Purkovi
Dobrovoljnih davalaca krvi 3/19, Zavidovii
061/ 690 - 241
5d0c55e6323450d8a19daab4a456af4f?d=identicon&s=25 Farsheed Bamboat (angeloflight)
on 2012-02-25 00:47
Attachment: warble.rb (6 KB)
Zijad Purkovic wrote in post #1048720:
> You can try with something like this in your warble.rb file:
>
> config.gems["actionpack"] = "2.3.8"
>
> Obviously, change the gem and version to match your gem.
>
> On Fri, Feb 24, 2012 at 11:38 PM, Farsheed Bamboat
> <lists@ruby-forum.com> wrote:
>>> do.
>> source "http://gems.github.com"
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>  http://xircles.codehaus.org/manage_email
>>
>>
>
>
>
> --
> Zijad Purkovi
> Dobrovoljnih davalaca krvi 3/19, Zavidovii
> 061/ 690 - 241

I added the details in the warble.rb file but to no avail. I'm not sure
whether I did it correctly so I've attached the file along with this
post. The added code is at the end of the file.

I still cannot see the gems in the JAR file after recreating it.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.