Support Rainbow gem both 1.99.x and 2.x

This fixes #762.