Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/bundler/shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "bundler/compatibility_guard"

require "pathname"
require "rbconfig"
require "rubygems"

require "bundler/version"
Expand Down Expand Up @@ -341,7 +342,7 @@ def set_rubyopt

def set_rubylib
rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
rubylib.unshift bundler_ruby_lib
rubylib.unshift bundler_ruby_lib unless RbConfig::CONFIG["rubylibdir"] == bundler_ruby_lib
Bundler::SharedHelpers.set_env "RUBYLIB", rubylib.uniq.join(File::PATH_SEPARATOR)
end

Expand Down
9 changes: 9 additions & 0 deletions spec/bundler/shared_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,15 @@
subject.set_bundle_environment
end

it "ignores if bundler_ruby_lib is same as rubylibdir" do
allow(Bundler::SharedHelpers).to receive(:bundler_ruby_lib).and_return(RbConfig::CONFIG["rubylibdir"])

subject.set_bundle_environment

paths = (ENV["RUBYLIB"]).split(File::PATH_SEPARATOR)
expect(paths.count(RbConfig::CONFIG["rubylibdir"])).to eq(0)
end

it "exits if bundle path contains the unix-like path separator" do
if Gem.respond_to?(:path_separator)
allow(Gem).to receive(:path_separator).and_return(":")
Expand Down