Add support for `GEM_HOME` and `GEM_PATH`

This should fix #657. Unfortunately I’m not versed in PHP unit testing proces (I’m front-end developer primarily) so I hope this won’t create any problems in merging this pull request. Please fell free to revise this pull request with any additions or fixes.
no, it should be before adding the extra env variables (here, it merges again after setting the ``GEM_HOME`` when setting ``GEM_PATH``, which might break things if the env already defines its own GEM_HOME which would win over the configured one)