Restrict the versions and add 3.1

'~> 2.6' will match 2.7.x.
Merge pull request #155 from richardc/patch-1

Restrict the versions and add 3.1