fix rails version check

In Rails 4, Rails.version returns an instance of Gem::Version.
Instead, we can check the major rails version directly.
Merge pull request #78 from tamird/patch-1

check major rails version directly