[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RAWR can't find jruby_fetch

Leslie Viljoen

12/18/2008 11:32:00 PM

[Note: parts of this message were removed to make it a legal post.]

Hi people!

I am trying to use RAWR to package a netbeans/monkeybars project, but am
running into some bugs.

First (on version 1.1.1) I was getting:
undefined local variable or method `processed_file' for main:Object

So I upgraded to 1.1.2, which apparently fixes that bug. Now I am getting:
no such file to load -- jruby_fetch

This is even if I try to use 'rake -T' on the RAWR generated rakefile. So
including RAWR is trying to load this
mysterious jruby_fetch gem that I cannot find any reference to anywhere.

Any help?

Les

5 Answers

Logan Barnett

12/19/2008 12:17:00 AM

0

Leslie,
Looks like yet another bug during the release.
Can you create an empty jruby_fetch.rb (touch jruby_fetch.rb) in your
project root? I tried this after reproducing the bug, and it let me
run the rawr:jar task after that.
I'll get a fix for that released on Monday.

On Dec 18, 2008, at 4:31 PM, Leslie Viljoen wrote:

> Hi people!
>
> I am trying to use RAWR to package a netbeans/monkeybars project,
> but am
> running into some bugs.
>
> First (on version 1.1.1) I was getting:
> undefined local variable or method `processed_file' for main:Object
>
> So I upgraded to 1.1.2, which apparently fixes that bug. Now I am
> getting:
> no such file to load -- jruby_fetch
>
> This is even if I try to use 'rake -T' on the RAWR generated
> rakefile. So
> including RAWR is trying to load this
> mysterious jruby_fetch gem that I cannot find any reference to
> anywhere.
>
> Any help?
>
> Les


Leslie Viljoen

12/19/2008 2:05:00 PM

0

On Fri, Dec 19, 2008 at 2:17 AM, Logan Barnett <logustus@gmail.com> wrote:

> Leslie,
> Looks like yet another bug during the release.
> Can you create an empty jruby_fetch.rb (touch jruby_fetch.rb) in your
> project root? I tried this after reproducing the bug, and it let me run t=
he
> rawr:jar task after that.
> I'll get a fix for that released on Monday.


Ok, did that. Then I get a message about a constant 'Java' that doesn't
exist - this didn't happen before with 1.1.1.
Anyway, so I took that as a cue to try and run everything through jruby lik=
e
so:

export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/jruby-1.1.4/b=
in
export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/jruby-1.1.4
jruby /usr/bin/gem install -r rawr
jruby /usr/bin/rake rawr:jar

This seems to work, I get:

(in /home/lesliev/monkey/ummpcomposer)
Copying non-source file compose/Composer.form to
/home/lesliev/monkey/ummpcomposer/package/classes/compose/Composer.form
Copying non-source file README.txt to
/home/lesliev/monkey/ummpcomposer/package/classes/README.txt
=3D=3D=3D Creating jar file:
/home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar

..but when I try and run it:

lesliev@lesliev-laptop:~/monkey/ummpcomposer/package/jar$ java -jar
ChangeMe.jar
Exception in thread "main" <script>:1:
file:/home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar!/main.class=
:1:
Invalid char `\276' ('=BE') in expression (SyntaxError)
from <script>:1:in `require'
from <script>:1
...internal jruby stack elided...


which I assume is because of this:
http://jira.codehaus.org/browse/...
I am running jruby 1.1.4 which came with netbeans.

So I guess I'll keep tinkering with jruby. I'm not really sure how jruby an=
d
ruby play together on the same machine - everything runs fine in the
Netbeans environment (my Monkeybars programs work well).

Logan Barnett

12/19/2008 4:54:00 PM

0


On Dec 19, 2008, at 7:05 AM, Leslie Viljoen wrote:

> On Fri, Dec 19, 2008 at 2:17 AM, Logan Barnett <logustus@gmail.com> =20=

> wrote:
>
>> Leslie,
>> Looks like yet another bug during the release.
>> Can you create an empty jruby_fetch.rb (touch jruby_fetch.rb) in your
>> project root? I tried this after reproducing the bug, and it let me =20=

>> run the
>> rawr:jar task after that.
>> I'll get a fix for that released on Monday.
>
>
> Ok, did that. Then I get a message about a constant 'Java' that =20
> doesn't
> exist - this didn't happen before with 1.1.1.
> Anyway, so I took that as a cue to try and run everything through =20
> jruby like
> so:
>

The latest Rawr is dependent on JRuby now. This weekend I'm planning =20
on setting up Rawr to be a JRuby only gem. This is so we can ride some =20=

of JRuby's code, such as classpath name mangling for the compiler, and =20=

perhaps the compiler itself (so you don't get incompatible versions =20
between your runtime JRuby and your environment JRuby in terms of what =20=

you compiled).

> export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/=20
> jruby-1.1.4/bin
> export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/=20
> jruby-1.1.4
> jruby /usr/bin/gem install -r rawr
> jruby /usr/bin/rake rawr:jar
>

You can use jruby -S to invoke a script from JRuby's bin. For example, =20=

jruby -S gem install rawr


> This seems to work, I get:
>
> (in /home/lesliev/monkey/ummpcomposer)
> Copying non-source file compose/Composer.form to
> /home/lesliev/monkey/ummpcomposer/package/classes/compose/=20
> Composer.form
> Copying non-source file README.txt to
> /home/lesliev/monkey/ummpcomposer/package/classes/README.txt
> =3D=3D=3D Creating jar file:
> /home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar
>
> ..but when I try and run it:
>
> lesliev@lesliev-laptop:~/monkey/ummpcomposer/package/jar$ java -jar
> ChangeMe.jar
> Exception in thread "main" <script>:1:
> file:/home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar!/=20
> main.class:1:
> Invalid char `\276' ('=BE') in expression (SyntaxError)
> from <script>:1:in `require'
> from <script>:1
> ...internal jruby stack elided...
>

Something is terribly wrong there in terms of the bytecode generated.
Things I would try:
1) jruby -S rake rawr:clean; jruby -S rake rawr:jar # =20
recompile the files
2) Find out if your environment JRuby differs from your runtime JRuby: =20=

jruby -v; java -jar lib/java/jruby-complete.jar -v
You may need to ensure these are the same by upgrading the version =20
Netbeans is using, or making your project use the Netbeans version.
1.1.4 is a bit old. Charles Nutter might know better than I if that =20
fixes certain problems. I believe 1.1.7 was just released.
3) Turn off Ruby compilation in your build configuration. All this =20
will do is copy the Ruby files into the jar. The end result should be =20=

that the startup time is a little slower than compiled mode (JRuby =20
will compile these files are they are required instead of having them =20=

compiled to start with).

Please let me know how any of that works out for you.

>
> which I assume is because of this:
> http://jira.codehaus.org/browse/...
> I am running jruby 1.1.4 which came with netbeans.
>
> So I guess I'll keep tinkering with jruby. I'm not really sure how =20
> jruby and
> ruby play together on the same machine - everything runs fine in the
> Netbeans environment (my Monkeybars programs work well).

I aliased my JRuby scripts to have a j in front. This way I have jgem, =20=

jrake, etc. Remembering where to install gems (did I update this gem =20
in MRI or JRuby?) was a problem at first, but that was the only =20
heartache I remember.



Logan Barnett

12/19/2008 5:12:00 PM

0


On Dec 19, 2008, at 9:54 AM, Logan Barnett wrote:

>
> On Dec 19, 2008, at 7:05 AM, Leslie Viljoen wrote:
>
>> On Fri, Dec 19, 2008 at 2:17 AM, Logan Barnett <logustus@gmail.com> =20=

>> wrote:
>>
>>> Leslie,
>>> Looks like yet another bug during the release.
>>> Can you create an empty jruby_fetch.rb (touch jruby_fetch.rb) in =20
>>> your
>>> project root? I tried this after reproducing the bug, and it let =20
>>> me run the
>>> rawr:jar task after that.
>>> I'll get a fix for that released on Monday.
>>
>>
>> Ok, did that. Then I get a message about a constant 'Java' that =20
>> doesn't
>> exist - this didn't happen before with 1.1.1.
>> Anyway, so I took that as a cue to try and run everything through =20
>> jruby like
>> so:
>>
>
> The latest Rawr is dependent on JRuby now. This weekend I'm planning =20=

> on setting up Rawr to be a JRuby only gem. This is so we can ride =20
> some of JRuby's code, such as classpath name mangling for the =20
> compiler, and perhaps the compiler itself (so you don't get =20
> incompatible versions between your runtime JRuby and your =20
> environment JRuby in terms of what you compiled).
>
>> export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/=20
>> jruby-1.1.4/bin
>> export PATH=3D$PATH:/home/lesliev/data/bin/netbeans-6.5/ruby2/=20
>> jruby-1.1.4
>> jruby /usr/bin/gem install -r rawr
>> jruby /usr/bin/rake rawr:jar
>>
>
> You can use jruby -S to invoke a script from JRuby's bin. For =20
> example, jruby -S gem install rawr
>
>
>> This seems to work, I get:
>>
>> (in /home/lesliev/monkey/ummpcomposer)
>> Copying non-source file compose/Composer.form to
>> /home/lesliev/monkey/ummpcomposer/package/classes/compose/=20
>> Composer.form
>> Copying non-source file README.txt to
>> /home/lesliev/monkey/ummpcomposer/package/classes/README.txt
>> =3D=3D=3D Creating jar file:
>> /home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar
>>
>> ..but when I try and run it:
>>
>> lesliev@lesliev-laptop:~/monkey/ummpcomposer/package/jar$ java -jar
>> ChangeMe.jar
>> Exception in thread "main" <script>:1:
>> file:/home/lesliev/monkey/ummpcomposer/package/jar/ChangeMe.jar!/=20
>> main.class:1:
>> Invalid char `\276' ('=BE') in expression (SyntaxError)
>> from <script>:1:in `require'
>> from <script>:1
>> ...internal jruby stack elided...
>>
>
> Something is terribly wrong there in terms of the bytecode generated.
> Things I would try:
> 1) jruby -S rake rawr:clean; jruby -S rake rawr:jar # =20
> recompile the files
> 2) Find out if your environment JRuby differs from your runtime =20
> JRuby: jruby -v; java -jar lib/java/jruby-complete.jar -v
> You may need to ensure these are the same by upgrading the version =20
> Netbeans is using, or making your project use the Netbeans version.
> 1.1.4 is a bit old. Charles Nutter might know better than I if that =20=

> fixes certain problems. I believe 1.1.7 was just released.
> 3) Turn off Ruby compilation in your build configuration. All this =20
> will do is copy the Ruby files into the jar. The end result should =20
> be that the startup time is a little slower than compiled mode =20
> (JRuby will compile these files are they are required instead of =20
> having them compiled to start with).
>
> Please let me know how any of that works out for you.
>
>>
>> which I assume is because of this:
>> http://jira.codehaus.org/browse/...
>> I am running jruby 1.1.4 which came with netbeans.
>>

I just had a chance to actually read the ticket. I would upgrade the =20
JRuby that's on your path (or just drop in a new one and put that on =20
your path instead) to 1.1.7.


>> So I guess I'll keep tinkering with jruby. I'm not really sure how =20=

>> jruby and
>> ruby play together on the same machine - everything runs fine in the
>> Netbeans environment (my Monkeybars programs work well).
>
> I aliased my JRuby scripts to have a j in front. This way I have =20
> jgem, jrake, etc. Remembering where to install gems (did I update =20
> this gem in MRI or JRuby?) was a problem at first, but that was the =20=

> only heartache I remember.
>
>
>


Charles Oliver Nutter

12/19/2008 7:17:00 PM

0

Logan Barnett wrote:
> I just had a chance to actually read the ticket. I would upgrade the
> JRuby that's on your path (or just drop in a new one and put that on
> your path instead) to 1.1.7.

Note that 1.1.7 is currently trunk and in development. You'd probably be
better off grabbing 1.1.6.

- Charlie