I tried to uninstall datamapper using the command gem uninstall dm-core.
But it seems that a whole bunch of dependent gems also need to be uninstalled.
The problem when running these sort of uninstalls is that they go down the list of gems in order so if a gum is uninstallable then you end up getting stuck. Run the below a few times and it should remove all the gems it is allowed to.
gem list | cut -d" " -f1 | sort -R | xargs -n1 gem uninstall -aIx