Here's a one-liner using /proc/uptime:

puts Time.now - File.read('/proc/uptime').match(/^(\d+\.\d+) /)[1].to_f

--
Jesse Merriman