Added fuzzy version matching and updated gems.

We couldn't update our gems to the latest versions because of features being deprecated.
I've added version constraints to all of the gems we require and updated them.
The updates appear to work properly in my tests.