My solution was this:
I uninstalled my current ruby installation which is for x64 system and replaced it with ruby x86/32bit installer and followed the steps given by @joelparkerhenderson.
Though I have x64 system, this is the only solution that worked for me.