If you come across this question trying to install Ruby using Ruby Version Manager (RVM) on Ubuntu 10.04 then there are instructions on installing zlib on the rvm web site http://rvm.beginrescueend.com/packages/zlib/
The steps are:
rvm pkg install zlib
(or
if you get “ERROR: Unrecognized command line argument: ‘pkg'” – older versions of rvm used the verb ‘package’ instead)
rvm package install zlib
then
rvm remove 1.9.1
rvm install 1.9.1