Skip to content

Commit caa09ef

Browse files
authored
Merge pull request #595 from k0kubun/default-gem-bundler
Avoid -I rubylibdir with default-gem bundler
2 parents f65c0b8 + 2fc1d35 commit caa09ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/spring/application_manager.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def start_child(preload = false)
9494
@child, child_socket = UNIXSocket.pair
9595

9696
Bundler.with_original_env do
97+
bundler_dir = File.expand_path("../..", $LOADED_FEATURES.grep(/bundler\/setup\.rb$/).first)
9798
@pid = Process.spawn(
9899
{
99100
"RAILS_ENV" => app_env,
@@ -102,7 +103,7 @@ def start_child(preload = false)
102103
"SPRING_PRELOAD" => preload ? "1" : "0"
103104
},
104105
"ruby",
105-
"-I", File.expand_path("../..", $LOADED_FEATURES.grep(/bundler\/setup\.rb$/).first),
106+
*(bundler_dir != RbConfig::CONFIG["rubylibdir"] ? ["-I", bundler_dir] : []),
106107
"-I", File.expand_path("../..", __FILE__),
107108
"-e", "require 'spring/application/boot'",
108109
3 => child_socket,

0 commit comments

Comments
 (0)