I have spent hours trying to get rails installed.

I kept getting a zlib error, but I had installed all known packages for zlib.

 

I then tried apt-get install libruby  ad that fixed everything.

I also tried this

rvm package install zlib
rvm remove 1.9.1
rvm install 1.9.1