summaryrefslogtreecommitdiff
path: root/lib/bundler/shared_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r--lib/bundler/shared_helpers.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 7ff391ab60..dca17885dd 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -300,7 +300,12 @@ module Bundler
def set_bundle_variables
begin
- Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", Bundler.rubygems.bin_path("bundler", "bundle", VERSION)
+ exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION)
+ unless File.exist?(exe_file)
+ exe_file = File.expand_path("../../../exe/bundle", __FILE__)
+ end
+
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
rescue Gem::GemNotFoundException
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../exe/bundle", __FILE__)
end