diff --git a/Rakefile b/Rakefile index 09d6da949c9..e7e2c6d1b81 100644 --- a/Rakefile +++ b/Rakefile @@ -3912,7 +3912,14 @@ namespace "build" do cp compileERB, $srcdir puts "Running bb.rb" - puts `#{$rubypath} -I"#{rhodeslib}" "#{$srcdir}/bb.rb"` + cmd_str = "#{$rubypath} -I#{rhodeslib} #{$srcdir}/bb.rb" + if defined?(Bundler) + Bundler.with_clean_env do + puts `#{cmd_str}` + end + else + puts `#{cmd_str}` + end unless $? == 0 puts "Error interpreting erb code" exit 1 @@ -4042,8 +4049,14 @@ namespace "build" do create_manifest cp compileERB, $srcdir puts "Running default.rb" - - puts `#{$rubypath} -I"#{rhodeslib}" "#{$srcdir}/default.rb"` + cmd_str = "#{$rubypath} -I#{rhodeslib} #{$srcdir}/default.rb" + if defined?(Bundler) + Bundler.with_clean_env do + puts `#{cmd_str}` + end + else + puts `#{cmd_str}` + end unless $? == 0 puts "Error interpreting erb code" exit 1 @@ -4053,7 +4066,14 @@ namespace "build" do cp compileRB, $srcdir puts "Running compileRB" - puts `#{$rubypath} -I"#{rhodeslib}" "#{$srcdir}/compileRB.rb"` + cmd_str = "#{$rubypath} -I#{rhodeslib} #{$srcdir}/compileRB.rb" + if defined?(Bundler) + Bundler.with_clean_env do + puts `#{cmd_str}` + end + else + puts `#{cmd_str}` + end unless $? == 0 puts "Error interpreting ruby code" exit 1