Fixing the railties dependency to >= 3.1 < 4.1