I have a web app which works, for the most part with MRI Ruby and JRuby. But...
When I am using MRI, I can do this.
> rails console
irb(main):001:0> a=Time.new(1,1,1,1,1)
=> 0001-01-01 01:01:00 -0500
i.e. It creates a new Time object for the specified time.
When I switch to JRuby I do this
> rails console
irb(main):001:0> a=Time.new(1,1,1,1,1)
ArgumentError: wrong number of arguments (5 for 0)
from (irb):2: in `evaluate`
from org/jruby/RubyKernel.java:1088 in `eval`
from /home/user/.rbenv/versions/jruby-1.6.4/lib/ruby/1.8/irb.rb:158 in `eval_input`
from /home/user/.rbenv/versions/jruby-1.6.4/lib/ruby/1.8/
....
How can I create a Time object in JRuby with a year, month, day, hour, and minutes which I control? If so, can this work with MRI Ruby as well?
I don't know if this is related, but
irb(main):002:0> RUBY_VERSION
"1.8.7"
Could my problem be because I'm in 1.8.7 mode? If so, how do I switch my rbenv/jruby-1.6.4 installation to act like RUBY_VERSION=1.9.2 ?