One reason to upgrade Ruby to 1.8.5
Last week I took a quick executive decision to deploy BiQ on Debian Etch instead of Sarge as initially planned. Mainly so we could take advantage of Ruby 1.8.5 (let me hear you scream “Mongrel”) and Subversion 1.4.something.
Today, yet another reason for going with Etch just bit me in the behind while using our development machine:
$ ruby -v
ruby 1.8.2 (2005-04-11) [i386-linux]
$ irb
irb(main):001:0> Time.mktime(1901, 12, 14)
=> Sat Dec 14 00:00:00 CET 1901
irb(main):002:0> Time.mktime(1901, 12, 13)
ArgumentError: time out of range
from (irb):2:in `mktime'
from (irb):2
(Don’t ask me why the split occurs on that date)
On the production server:
$ ruby -v
ruby 1.8.5 (2006-08-25) [i486-linux]
$ irb
irb(main):001:0> Time.mktime(1901, 12, 14)
=> Sat Dec 14 00:00:00 +0100 1901
irb(main):002:0> Time.mktime(1901, 12, 13)
=> Fri Dec 13 21:45:52 +0100 1901
Looks like our good old development machine will be going Etch one of these days.
Update: Ruby 1.8.5 doesn’t solve it
On further digging this appears to specific to architecture/hardware rather than version of Ruby:
$ ruby -v
ruby 1.8.5 (2006-08-25) [i386-freebsd5]
$ irb
irb(main):001:0> Time.mktime(1901,12,14)
=> Sat Dec 14 00:00:00 +0000 1901
irb(main):002:0> Time.mktime(1901,12,13)
ArgumentError: time out of range
from (irb):2:in `mktime'
from (irb):2
from :0
i486 works, i386 doesn’t.