I deleted and reinstalled ruby 1.9.2 via RVM and then uninstalled all gems:
gem list --no-versions
Put the result in a file called gems (cut out the error messages). Then do:
GEMS=`cat gems`
for x in $GEMS ; do gem uninstall $x -aIx; done
After that I was able to run the pristine command suggested by others:
gem pristine --all --no-extensions
That's when the errors disappeared.