Rspec problem with jruby

I’m not sure if this falls to rspec or jruby, but if resolving it has
anything to do with not being able to run focused specs from
NetBeans, then I’d LOVE to resolve it.

http://rubyforge.org/pipermail/rspec-users/2008-October/009734.html

Thanks,
-lenny


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Lenny M. wrote:

I’m not sure if this falls to rspec or jruby, but if resolving it has
anything to do with not being able to run focused specs from NetBeans,
then I’d LOVE to resolve it.

http://rubyforge.org/pipermail/rspec-users/2008-October/009734.html

It sounds like it must be a JRuby issue…can you file a bug for it with
a sample spec and command line to reproduce?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Oct 28, 2008, at 11:41 PM, Charles Oliver N. wrote:

Lenny M. wrote:

I’m not sure if this falls to rspec or jruby, but if resolving it
has anything to do with not being able to run focused specs from
NetBeans, then I’d LOVE to resolve it.
http://rubyforge.org/pipermail/rspec-users/2008-October/009734.html

It sounds like it must be a JRuby issue…can you file a bug for it
with a sample spec and command line to reproduce?

http://jira.codehaus.org/browse/JRUBY-3092

Thanks,
-lenny


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi,

I’m doing some work with Java3D 1.5.3/JRuby 1.1.4, and I’m trying to
subclass from a class in Java3D:

class Smoo < javax.media.j3d.Behavior
def initialize
timcon = javax.media.j3d.WakeupOnElapsedTime.new(1000)
self.wakeupOn(timcon)
end

def processCondition
p “in process condition\n”
end
end

when I instantiate Smoo, I get a missing_method failure on the call to
wakeupOn, which is a method of javax.media.j3d.Behavior

when I call Smoo.methods, wakeupOn and a whole bunch of other methods
are missing from the list, but one method, getNumSchedulingIntervals()
is listed. That public function returns a static int.

If I create a direct instantiation of Behavior, I can call wakeupOn()
and other methods, without a problem.

can someone shed some light on what I’m going wrong ??


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

john casu wrote:

def processCondition
p “in process condition\n”
end
end

when I instantiate Smoo, I get a missing_method failure on the call to
wakeupOn, which is a method of javax.media.j3d.Behavior

Are the missing methods protected? There’s a standing bug in 1.1.4 and
lower that protected methods are never invokable (and don’t even get
listed), even for subclasses. That’s fixed in trunk/1.1.5 by listing
them and forcing them to be accessible so long as security settings
allow it.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles Oliver N. wrote:

end
Are the missing methods protected? There’s a standing bug in 1.1.4 and
lower that protected methods are never invokable (and don’t even get
listed), even for subclasses. That’s fixed in trunk/1.1.5 by listing
them and forcing them to be accessible so long as security settings
allow it.

Charlie,

wakeupOn() is protected, but other missing methods, such as
getEnable() are not. initialize & processCondition are abstract classes,
and they are not listed when I do the direct instantiation of Behavior.
In fact, the only method that seem to get listed is the one that returns
a static int.

I guess my fix is to download the 1.1.5 branch.

thanks,

-john c

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’m trying to download the latest snapshot of jruby from svn, and it’s
failing for me. Since I am able to svn from other repos, I’m guessing
there’s an issue with the codehaus svn server.

some help would be appreciated.

thanks,

-john c.

enterprise:jruby-1.1.5-svn casuj$ svn co
svn://svn.codehaus.org/jruby/trunk/jruby jruby
svn: Can’t connect to host ‘svn.codehaus.org’: Operation timed out
enterprise:jruby-1.1.5-svn casuj$ ping svn.codehaus.org
PING svn.codehaus.org (63.246.2.115): 56 data bytes
64 bytes from 63.246.2.115: icmp_seq=0 ttl=48 time=72.033 ms
64 bytes from 63.246.2.115: icmp_seq=1 ttl=48 time=68.740 ms
64 bytes from 63.246.2.115: icmp_seq=2 ttl=48 time=79.669 ms


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charlie,

I downloaded /trunk/jruby from the svn (2008-10-29 version), built it
and ran my code. Still busted, but given that I couldn’t find a
specific 1.1.5 branch/tag/version of jruby, I’m guessing I’m still using
the wrong version.

thanks for your help,

-john c.

Charles Oliver N. wrote:

end
Are the missing methods protected? There’s a standing bug in 1.1.4 and
http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

apologies, was being a retard.

svn co svn://svn.codehaus.org/jruby/trunk/jruby/

seem to be the correct invocation

john casu wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Looks like you’re running off trunk, yes? There’s some known issues with
revisions around where you’re at, so you may want to try to pull down
current trunk and check it again. If there’s still a problem, let us
know and file a bug too.

Luis Landeiro R. wrote:

Loading development environment (Rails 2.1.2)

NilClass
13:54:30", updated_at: “2008-10-29 13:54:30”>, #<Account id: 1, title:
nil, user_id: 1, created_at: “2008-10-29 13:54:20”, updated_at:



To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’ve detected a weird behaviour on the max(&block) method from
enumerable when invoked on a has_many relation of rails.

The attachment file contains a rails environment where the
issue can be tested.

The following code exposes the bug ,

ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
lribeiro@wheat:~/test$ /usr/bin/ruby script/console
Loading development environment (Rails 2.1.2)

u = User.first
u.accounts.max{|x,y| puts x.class; puts y.class; -1}
Account
Account
Account
Account
Account
Account
Account
Account

jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-10-29 rev 7939)
[i386-java]
lribeiro@wheat:~/test$ jruby script/console

User.first.accounts.class
=> >> User.first.accounts.max{|x,y| puts x.class; puts y.class; -1}
Array
NilClass
Array
NilClass
Array
NilClass
Array
NilClass

User.first.accounts.max{|x,y| puts x.inspect; puts y.class; -1}
[#<Account id: 2, title: nil, user_id: 1, created_at: “2008-10-29
13:54:29”, updated_at: “2008-10-29 13:54:29”>, #<Account id: 1, title:
nil, user_id: 1, created_at: “2008-10-29 13:54:20”, updated_at:
“2008-10-29 13:54:20”>]
NilClass
[#<Account id: 3, title: nil, user_id: 1, created_at: “2008-10-29
13:54:30”, updated_at: “2008-10-29 13:54:30”>, #<Account id: 1, title:
nil, user_id: 1, created_at: “2008-10-29 13:54:20”, updated_at:
“2008-10-29 13:54:20”>]
NilClass
[#<Account id: 4, title: nil, user_id: 1, created_at: “2008-10-29
13:54:30”, updated_at: “2008-10-29 13:54:30”>, #<Account id: 1, title:
nil, user_id: 1, created_at: “2008-10-29 13:54:20”, updated_at:
“2008-10-29 13:54:20”>]
NilClass
[#<Account id: 5, title: nil, user_id: 1, created_at: “2008-10-29
13:54:30”, updated_at: “2008-10-29 13:54:30”>, #<Account id: 1, title:
nil, user_id: 1, created_at: “2008-10-29 13:54:20”, updated_at:
“2008-10-29 13:54:20”>]
NilClass
=> #<Account id: 1, title: nil, user_id: 1, created_at: “2008-10-29
13:54:20”, updated_at: “2008-10-29 13:54:20”>

If we clone the array, them max behaves has MRI,
so User.first.account.clone.max{|x,y| puts x.inspect; puts y.class; -1},
yields the same results on both MRI and JRUBY.
I suspect some association proxy in rails may be the culprit.

I’ve tested the issue against trunk, but I remember a fellow developer
hitting the same bug a few months ago (at the time I lacked the time to
investigate the issue), so older versions should also be affected.

Cheers
Luis Landeiro

Hey All,

Is this a place I can get help w/installation? I’m on windows xp & am
seeing this:

C:\DeleteMe\jruby\jruby-1.1.4\bin>jruby -v
The system cannot find the path specified.

If this is not a good place for this question, apologies & do please
direct me…

Thanks!

-Roy

Roy P.
Research Analyst/Programmer
Group Health Center For Health Studies (Cancer Research Network)
(206) 287-2078
Google Talk: rpardee


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Roy,

It is highly recommended to add JRuby’s bin directory to environment
variable %PATH%, so that you will be able to simply invoke jruby
without full path.

Thanks,
–Vladimir

On Thu, Oct 30, 2008 at 4:17 PM, Pardee, Roy [email protected] wrote:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

tidy steps for install:

  1. download / unzip the jruby dist
    i.e. http://dist.codehaus.org/jruby/jruby-bin-1.1.4.zip >
    C:\DeleteMe\jruby\jruby-1.1.4\bin
    (by the way, jruby doesn’t belong in a dir called “DeleteMe”!!! :slight_smile:
  2. set path variables:
    JAVA_HOME : make sure this is set to your java dir… i.e.
    C:\Program
    Files\Java\jdk1.5.blah-blah
    JRUBY_HOME : C:\DeleteMe\jruby\jruby-1.1.4 in your case
    PATH : add this to the end of your PATH variable : %JRUBY_HOME%\bin

For help “setting windows environment variables” :
http://www.google.com/search?hl=en&q=setting%20windows%20environment%20variables
Jruby wiki for install:
http://wiki.jruby.org/wiki/Getting_Started#Installing_JRuby

This should do the trick for you, remember to change your env variables
when
you decide to move JRuby out of the “DeleteMe” directory!

M
On Thu, Oct 30, 2008 at 11:46 AM, Vladimir S.
[email protected]wrote:

Hey All,
Thanks!
To unsubscribe from this list, please visit:


Aloha!

Mike McKinney
(http://blog.huikau.com)

Ach–sorry–forgot to mention that I did that. I cd’d into the bin
directory after getting that error just out of superstition. But I
believe the system is finding jruby.exe, b/c I get a different error if
I try to call something I know doesn’t exist:

C:>jruby
The system cannot find the path specified.

C:>fargle
‘fargle’ is not recognized as an internal or external command,
operable program or batch file.

I’m guessing there’s something wrong w/the JRE maybe? Not a java guy,
so don’t know how to dx… :frowning:

Thanks!

-Roy

P.S.
make sure you open a new console window, then type in the jruby -v…
(console windows that are open while you set environment variables will
not
have the new settings…)

On Thu, Oct 30, 2008 at 12:02 PM, Mike McKinney [email protected] wrote:

PATH : add this to the end of your PATH variable : %JRUBY_HOME%\bin

direct me…

(http://blog.huikau.com)


Aloha!

Mike McKinney
(http://blog.huikau.com)

On Thu, Oct 30, 2008 at 4:55 PM, Pardee, Roy [email protected] wrote:

Ach–sorry–forgot to mention that I did that. I cd’d into the bin directory after getting that error just out of superstition. But I believe the system is finding jruby.exe, b/c I get a different error if I try to call something I know doesn’t exist:

C:>jruby
The system cannot find the path specified.

C:>fargle
‘fargle’ is not recognized as an internal or external command,
operable program or batch file.

Indeed! Then then the most typical case for this is wrong %JAVA_HOME%
variable, it should point to the appropriate JDK/JRE installed.

Also, try to invoke jruby when you’re are not inside bin
directory. There were some problems with this in the past.

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Pardee, Roy wrote:

Hey All,

Is this a place I can get help w/installation? I’m on windows xp & am seeing this:

C:\DeleteMe\jruby\jruby-1.1.4\bin>jruby -v
The system cannot find the path specified.

This sounds like it could be a problem in the batch files that start
jruby. You might be able to figure out where it’s failing by removing
@echo off” from the beginning of *.bat in the jruby bin directory.


Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ah–thanks! It was the JAVA_HOME var–had been pointing to a
nonexistant dir.

Heh–yeah, I need to rename that DeleteMe dir–it’s a misnomer.

Thanks!

-Roy


From: Mike McKinney [mailto:[email protected]]
Sent: Thursday, October 30, 2008 9:02 AM
To: [email protected]
Subject: Re: [jruby-user] installation help?

tidy steps for install:

  1. download / unzip the jruby dist
    i.e. http://dist.codehaus.org/jruby/jruby-bin-1.1.4.zip >
    C:\DeleteMe\jruby\jruby-1.1.4\bin
    (by the way, jruby doesn’t belong in a dir called “DeleteMe”!!! :slight_smile:
  2. set path variables:
    JAVA_HOME : make sure this is set to your java dir… i.e.
    C:\Program Files\Java\jdk1.5.blah-blah
    JRUBY_HOME : C:\DeleteMe\jruby\jruby-1.1.4 in your case
    PATH : add this to the end of your PATH variable : %JRUBY_HOME%\bin

For help “setting windows environment variables” :
http://www.google.com/search?hl=en&q=setting%20windows%20environment%20variables
Jruby wiki for install:
http://wiki.jruby.org/wiki/Getting_Started#Installing_JRuby

This should do the trick for you, remember to change your env variables
when you decide to move JRuby out of the “DeleteMe” directory!

M
On Thu, Oct 30, 2008 at 11:46 AM, Vladimir S.
<[email protected]mailto:[email protected]> wrote:
Hi Roy,

It is highly recommended to add JRuby’s bin directory to environment
variable %PATH%, so that you will be able to simply invoke jruby
without full path.

Thanks,
–Vladimir

On Thu, Oct 30, 2008 at 4:17 PM, Pardee, Roy
<[email protected]mailto:[email protected]> wrote:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Aloha!

Mike McKinney
(http://blog.huikau.com)

This is still broken in today’s 1.1.5 release, but I’m getting a
different error message:

gui/gui_display.rb:40:in initialize': invokee not a java object (TypeError) from gui/gui_display.rb:130:in initialize’
from /Users/casuj/NetBeansProjects/rumcad/lib/main.rb:14

the line that fails is the “self.wakeupOn(timcon)” line as below.

thanks,
-john c.

john casu wrote:

class Smoo < javax.media.j3d.Behavior

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email