the thing with rammus, is that even with wards he can still gank because he is too fast.
How to prevent that?
I find freezing the lane (when i play top) near my tower to be pretty effective thought, but for mid lane or bot lane i dont know...
Run exhaust and flash.
Exhaust him, once he's gonna catch you he should be at the end of his Q, then flash to the side(This is of course only if you're running exhaust and flash, but I usually run these anyway).
If playing Alistar or Blitz(or any champ with a good cc really), use your cc on him before he lands the q, it will cancel it and stun him.