ruby-libtommath is a ruby extension encapsulating the LibTomMath multi-precision integer library (http://libtom.org/?page=features&newsitems=5&whatfile=ltm). It has been written to be an almost complete drop in replacement for ruby's Bignum.