you have to install the *system* zlib library first, then rebuild ruby.
Search your package manager for (z)ziplib.

-klaus