Fix version check

Rails version now returns a Gem::Version, so we need to convert it to string before comparing.