Fix installation with installed gems

This fixes breakage added in other DependencyInstaller tests after
adding recognition of installed gems.