If you are newbie on linux you might run into the same problem i had. I tried to install ruby and then ruby on rails by compiling source code of ruby and then just try gem install rails. Everything worked untill i tried that command… I was getting that awful “no such file to load — zlib” error – hey im still newbie i have no idea what that is…
After oh so many hours later i found solution, both as a wall of text and as a screencast!