Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird syntax error inconsistency in Jruby
    text
    copied!<p>I'm running into an inconsistency between Jruby running on OS X and a production Ubuntu host. On my production host, I have the following:</p> <pre><code>~ $ java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) ~ $ rvm use jruby-1.6.8 Using /home/ubuntu/.rvm/gems/jruby-1.6.8 ~ $ rvm list rubies rvm rubies =&gt; jruby-1.6.8 [ x86_64 ] * ruby-1.9.2-p318 [ x86_64 ] # =&gt; - current # =* - current &amp;&amp; default # * - default ~ $ irb jruby-1.6.8 :001 &gt; def foo(*args) jruby-1.6.8 :002?&gt; end =&gt; nil jruby-1.6.8 :003 &gt; foo(1, jruby-1.6.8 :004 &gt; 2, jruby-1.6.8 :005 &gt; ) SyntaxError: (irb):5: syntax error, unexpected tRPAREN ) ^ from org/jruby/RubyKernel.java:1112:in `eval' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:158:in `eval_input' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:271:in `signal_status' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:155:in `eval_input' from org/jruby/RubyKernel.java:1439:in `loop' from org/jruby/RubyKernel.java:1212:in `catch' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:154:in `eval_input' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:71:in `start' from org/jruby/RubyKernel.java:1212:in `catch' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/lib/ruby/1.8/irb.rb:70:in `start' from /home/ubuntu/.rvm/rubies/jruby-1.6.8/bin/irb:17:in `(root)' </code></pre> <p>That is (I believe) valid Ruby code, but more importantly, it seems to be valid jruby code, since it works fine on my OS X box:</p> <pre><code>~ $ java -version java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) ~ $ rvm use jruby-1.6.8 Using /Users/lwiman/.rvm/gems/jruby-1.6.8 ~ $ rvm list rubies rvm rubies jruby-1.6.4 [ x86_64 ] jruby-1.6.7 [ x86_64 ] =&gt; jruby-1.6.8 [ x86_64 ] * ruby-1.9.2-p290 [ x86_64 ] ruby-1.9.3-p194 [ x86_64 ] # =&gt; - current # =* - current &amp;&amp; default # * - default ~ $ irb jruby-1.6.8 :001 &gt; def foo(*args) jruby-1.6.8 :002?&gt; end =&gt; nil jruby-1.6.8 :003 &gt; foo(1, jruby-1.6.8 :004 &gt; 2, jruby-1.6.8 :005 &gt; ) =&gt; nil jruby-1.6.8 :006 &gt; </code></pre> <p>Any help fixing this issue would be greatly appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload