我得到了很多語法錯誤:JRuby是否支持{thing:「hello」}語法?
SyntaxError: /Users/davidtuite/dev/ruby/seenbefore_client/spec/lib/url_group_spec.rb:40: syntax error, unexpected ':'
records = stub(length: length)
尚JRuby Blog說:「現在的編譯器處理所有1.9語法」,因爲JRuby的1.6.0.rc2。
我使用JRuby 1.6.5
rvm info
ruby:
interpreter: "jruby"
version: "1.6.5"
date: "2011-10-25"
platform: "darwin-x86_64-java"
patchlevel: "TM"
full_version: "jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]"
您必須[使用1.9模式](http://stackoverflow.com/questions/4755900/how-to-make-jruby-1-6-default-to-ruby-1-9)。 – yfeldblum 2012-01-29 15:54:27