def _get_gem_path(incpaths):
    """
    incpaths is a list of `<bundle_name>/lib/ruby/<version>/gems/<gemname>-<gemversion>/lib`
    The gem_path is `<bundle_name>/lib/ruby/<version>` so we can go from an incpath to the
    gem_path pretty easily without much additional work.
    """
    if len(incpaths) == 0:
        return ""
    incpath = incpaths[0]
    return incpath.rsplit("/", 3)[0]