Support Gem::Version properly

I haven't tested this with rails < 4-master, but this fixes breakage where Rails.version now returns a Gem::Version and these comparisons fail there.  This is the offending commit afaict: https://github.com/rails/rails/commit/c07e1515f7c66f5599cbb3c7e9fe42e166bf3edc