lib/bundler/cli.rb in bundler-0.9.16 vs lib/bundler/cli.rb in bundler-0.9.17
- old
+ new
@@ -161,12 +161,14 @@
# Set BUNDLE_GEMFILE
ENV['BUNDLE_GEMFILE'] = Bundler::SharedHelpers.default_gemfile.to_s
# Set RUBYOPT
rubyopt = [ENV["RUBYOPT"]].compact
- rubyopt.unshift "-rbundler/setup"
- rubyopt.unshift "-I#{File.expand_path('../..', __FILE__)}"
- ENV["RUBYOPT"] = rubyopt.join(' ')
+ if rubyopt.empty? || rubyopt.first !~ /-rbundler\/setup/
+ rubyopt.unshift "-rbundler/setup"
+ rubyopt.unshift "-I#{File.expand_path('../..', __FILE__)}"
+ ENV["RUBYOPT"] = rubyopt.join(' ')
+ end
begin
# Run
Kernel.exec *ARGV
rescue Errno::ENOENT