module Bundler::SharedHelpers

def clean_load_path

def clean_load_path
  loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
  $LOAD_PATH.reject! do |p|
    resolved_path = resolve_path(p)
    next if $LOADED_FEATURES.any? {|lf| lf.start_with?(resolved_path) }
    loaded_gem_paths.delete(p)
  end
  $LOAD_PATH.uniq!
end