The loop was caused by rbenv-gemset's rbenv-which hook, which was called when rbenv-which was invoked. rbenv-gemset's hook then invoked rbenv-prefix, which (when version is "system") in turn invokes rbenv-which, and the cycle continued. This solution gives a hard default directory for system gemsets.
…d over correctly. Closes #2.