diff --git a/lib/ruby_installer/build/msys2_installation.rb b/lib/ruby_installer/build/msys2_installation.rb index 81c668222..a3c2d5c14 100644 --- a/lib/ruby_installer/build/msys2_installation.rb +++ b/lib/ruby_installer/build/msys2_installation.rb @@ -46,6 +46,10 @@ def reset_cache end def iterate_msys_paths + # Prefer MSYS2_PATH if ENV set + if ENV["MSYS2_PATH"] + yield ENV["MSYS2_PATH"] + end # Prefer MSYS2 when installed within the ruby directory. yield File.join(RbConfig::TOPDIR, "msys64") yield File.join(RbConfig::TOPDIR, "msys32")