Jruby can't see iso8601 method

I’m getting really strange behaviour in my JRuby process where methods
just go missing.

Here’s a pastebin showing an invocation of iso8601 throwing a
NoMethodError.

Does anyone have any idea what’s going on here?

vic

Please use 1.9 mode with ‘–1.9’ flag.

$ jruby --1.9 -S irb
irb(main):001:0> require ‘time’
=> true
irb(main):002:0> Time.now.utc.iso8601
=> “2011-12-16T16:11:11Z”

Oh, sorry. I misunderstood. I’ll look into it.

I’m doing this inside of logstash, so maybe something is up, but things
look ok to me:

(rdb:1) set autoeval on
autoeval is on.
(rdb:1) puts RUBY_VERSION
1.9.2
nil
(rdb:1) require ‘time’
false
(rdb:1) Time.now.utc.iso8601
NoMethodError Exception: undefined method `iso8601’ for 2011-12-16
16:43:38 UTC:Time
(rdb:1)

Hmm. I don’t see this on my machine.

$ jruby --debug -d -S irb
jruby-1.6.4 :001 > require ‘time’
=> true
jruby-1.6.4 :002 > Time.now.utc.iso8601
=> “2011-12-16T16:16:56Z”