Unexpected kIN (SyntaxError)

I’m getting the following when trying to run a ruby program with JRuby

============
:1: C:/Program Files/jruby-1.4.0/bin/JRuby:17: , unexpected kIN
(SyntaxError)

case “uname” in
^

===========
The script runs just fine with regular ruby. prior to a few
modifications it ran just fine with JRuby.

I googled and found some indication of an error like this, but it
appeared to be corrected in 1.4.0 (which I’m running)

I haven’t been able to back out the changes to get it running again, so
I’m not really sure what triggers it.

Same problem earlier today, made a couple of minor changes and the
script was working agin.

very frustrating, I could really use the improved performance of JRuby.

Hi Mike,

Any small test case that exposes this error would be appreciated.

You seems to be running under Cygwin? Try jruby.exe with exe extension
explicitly, that would execute the native binary, not the shell
script.

Thanks,
–Vladimir

On Sat, Nov 28, 2009 at 3:34 AM, Mike C. [email protected]
wrote:

The script runs just fine with regular ruby. prior to a few
script was working agin.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for the hint. If I can come up with a small script that breaks
and what causes the break, I’ll post it.

I tried your suggestion of JRuby.exe and got the same results.

Vladimir S. wrote:

Hi Mike,

Any small test case that exposes this error would be appreciated.

You seems to be running under Cygwin? Try jruby.exe with exe extension
explicitly, that would execute the native binary, not the shell
script.

Thanks,
–Vladimir

On Sat, Nov 28, 2009 at 3:34 AM, Mike C. [email protected]
wrote:

The script runs just fine with regular ruby. prior to a few
script was working agin.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Mike,

On Sat, Nov 28, 2009 at 1:47 PM, Mike C. [email protected]
wrote:

Thanks for the hint. If I can come up with a small script that breaks
and what causes the break, I’ll post it.

Thanks.

I tried your suggestion of JRuby.exe and got the same results.

Hmm, this just can’t be possible. :slight_smile: The whole point of invoking
jruby.exe is to avoid running any jruby shell script.

Maybe, I’ve just misunderstood what you trying to do.

So, you have a ruby script, say, runme.rb and you’d like to run it?
And this is on Windows, right? Cygwin or not?

So, you do

jruby.exe runme.rb

and this produces the error?

Thanks,
–Vladimir

–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

That’s right…

C:.…>jRuby.exe assignZCats.rb
:1: C:/Program Files/jruby-1.4.0/bin/jRuby:17: , unexpected kIN
(SyntaxError)

case “uname” in
^

I don’t recall installing Cygwin.

On Nov 28, 2009, at 8:49 AM, Vladimir S. wrote:

Hmm, this just can’t be possible. :slight_smile: The whole point of invoking

script was working agin.

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Do you have any system(), exec() or backtick `` calls in
your script?
No
but
in that script you’re trying to launch another jruby process. Is that
possible?
The only thing I’m doing close to this is using require for Ruby
modules in the same directory. But, since everything works just fine
if I call the jruby.exe by its full path name, that would not seem to
explain it. I also have other scripts in the same directory doing the
same thing that run fine when executed by jruby (no .exe)

It’s very strange. I’m managing to get my work done, but certainly
can’t understand how the shell script gets invoked sometimes.

On Nov 29, 2009, at 3:22 AM, Vladimir S. wrote:

I tried your suggestion of JRuby.exe and got the same results.

wrote:


http://xircles.codehaus.org/manage_email


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

Hi Mike,

I’m really puzzled by this. The only logical explanation I see is that
the actual assignZCats.rb file is being executed by jruby.exe, but
in that script you’re trying to launch another jruby process. Is that
possible? Do you have any system(), exec() or backtick `` calls in
your script?

Thanks,
–Vladimir

On Sat, Nov 28, 2009 at 6:59 PM, Mike C. [email protected] wrote:

On Nov 28, 2009, at 8:49 AM, Vladimir S. wrote:

jruby.exe runme.rb

Any small test case that exposes this error would be appreciated.

The script runs just fine with regular ruby. prior to a few
Posted via http://www.ruby-forum.com/.
To unsubscribe from this list, please visit:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Mike,

On Sun, Nov 29, 2009 at 2:49 PM, Mike C. [email protected] wrote:

It’s very strange. I’m managing to get my work done, but certainly
can’t understand how the shell script gets invoked sometimes.

I finally got it!!! :slight_smile:

You seem to be invoking jruby.exe with command like ‘jRuby’, right?

And jruby.exe doesn’t like it, since we have some magic in it to look
into its own name and do some tricks.

Like, for example you could copy jruby.exe to rake.exe, and then this
launcher will look into its name, notice that it is not jruby anymore
and then launch: jruby -S rake.

In your case it sees jRuby, it doesn’t realize that jRuby is equal to
jruby, and launches jruby -S jRuby, finds the shell scripts and gets
very confused, confusing us along the way. :slight_smile:

In short:

  1. Use jruby , not jRuby in order to launch it.
  2. This is a bug in jruby launcher, it should compare in
    case-insensitive mode.

Thanks,
–Vladimir

Thanks,

Thanks.

Vladimir S. wrote:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:


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

Hi Mike,

The bug report for your problem is here:
http://jira.codehaus.org/browse/JRUBY-4288
I’ve just fixed it in jruby-launcher workspace, and it should
eventually end up in JRuby 1.5 as well.

Thanks for reporting it!

–Vladimir

On Sun, Nov 29, 2009 at 2:49 PM, Mike C. [email protected] wrote:

explain it. I also have other scripts in the same directory doing the

the actual assignZCats.rb file is being executed by jruby.exe, but

C:.…>jRuby.exe assignZCats.rb

explicitly, that would execute the native binary, not the shell

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