How to run 2.2.2 and 2.3 / 1.8.7 and 1.9 on same dev box

I am starting new project and want to jump into the 2.3 / 1.9 world.

How do I run both envirnments on same box.

I inderstand I can freeze 2.2.2 in my current aps, but a little lost on the 1.8.7 and 1.9 ruby runtime world.