File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1212 Bundler . ui . error e . message
1313 Bundler . ui . warn e . backtrace . join ( "\n " ) if ENV [ "DEBUG" ]
1414 if e . is_a? ( Bundler ::GemNotFound )
15- suggested_cmd = "bundle install"
15+ suggested_bundle = Gem . loaded_specs [ "bundler" ] ? "bundle" : Bundler ::SharedHelpers . bundle_bin_path
16+ suggested_cmd = "#{ suggested_bundle } install"
1617 original_gemfile = Bundler . original_env [ "BUNDLE_GEMFILE" ]
1718 suggested_cmd += " --gemfile #{ original_gemfile } " if original_gemfile
1819 Bundler . ui . warn "Run `#{ suggested_cmd } ` to install missing gems."
Original file line number Diff line number Diff line change @@ -304,6 +304,13 @@ def set_env(key, value)
304304 public :set_env
305305
306306 def set_bundle_variables
307+ Bundler ::SharedHelpers . set_env "BUNDLE_BIN_PATH" , bundle_bin_path
308+ Bundler ::SharedHelpers . set_env "BUNDLE_GEMFILE" , find_gemfile . to_s
309+ Bundler ::SharedHelpers . set_env "BUNDLER_VERSION" , Bundler ::VERSION
310+ Bundler ::SharedHelpers . set_env "BUNDLER_SETUP" , File . expand_path ( "setup" , __dir__ )
311+ end
312+
313+ def bundle_bin_path
307314 # bundler exe & lib folders have same root folder, typical gem installation
308315 exe_file = File . expand_path ( "../../exe/bundle" , __dir__ )
309316
@@ -313,11 +320,9 @@ def set_bundle_variables
313320 # bundler is a default gem, exe path is separate
314321 exe_file = Bundler . rubygems . bin_path ( "bundler" , "bundle" , VERSION ) unless File . exist? ( exe_file )
315322
316- Bundler ::SharedHelpers . set_env "BUNDLE_BIN_PATH" , exe_file
317- Bundler ::SharedHelpers . set_env "BUNDLE_GEMFILE" , find_gemfile . to_s
318- Bundler ::SharedHelpers . set_env "BUNDLER_VERSION" , Bundler ::VERSION
319- Bundler ::SharedHelpers . set_env "BUNDLER_SETUP" , File . expand_path ( "setup" , __dir__ )
323+ exe_file
320324 end
325+ public :bundle_bin_path
321326
322327 def set_path
323328 validate_bundle_path
You can’t perform that action at this time.
0 commit comments