fix rails version check

In Rails 4, Rails.version returns an instance of Gem::Version.
We need to cast it to a string before calling `#start_with?` on it.

check the major rails version directly