diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index 6b3ec69ecc..1a2cf7598b 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -31,7 +31,11 @@ module OnSystem return false if Homebrew::SimulateSystem.simulating_or_running_on_linux? base_os = MacOS::Version.from_symbol(os_name) - current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) + current_os = if Homebrew::SimulateSystem.current_os == :macos + Version::NULL + else + MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) + end return current_os >= base_os if or_condition == :or_newer return current_os <= base_os if or_condition == :or_older