ensure Rails is defined before checking version

This issue was uncovered in the discussion here:

https://github.com/lemurheavy/coveralls-public/issues/35#issuecomment-16317261