Check that Rails responds to root

This fixes: `undefined method 'root' for Rails:Module` in a non-Rails project but where the Rails module is still defined.

I'm not sure exactly what causes this to happen. It seems to be a similar problem to this: https://github.com/sevenwire/forgery/issues/5. My guess is that some gem is including Rails in my project, but it's not being configured / set up properly.

Wasn't sure what kind of tests would need to be written to get this accepted, but I did confirm that it fixes the issues I'm having in my Goliath app.

Thanks for taking the time to check this out