add failing spec and fix rails version check
use Gem::Version for all version checks
Merge pull request #1023 from justinfrench/fix-rails-version-detection

Fix rails version detection