Exception: BuildFlagsError

Inherits:
RuntimeError
  • Object
show all
Defined in:
Library/Homebrew/exceptions.rb

Overview

raised by Homebrew.install, Homebrew.reinstall, and Homebrew.upgrade if the user passes any flags/environment that would case a bottle-only installation on a system without build tools to fail

Instance Method Summary collapse

Constructor Details

#initialize(flags, bottled: true) ⇒ BuildFlagsError

Returns a new instance of BuildFlagsError



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'Library/Homebrew/exceptions.rb', line 461

def initialize(flags, bottled: true)
  if flags.length > 1
    flag_text = "flags"
    require_text = "require"
  else
    flag_text = "flag"
    require_text = "requires"
  end

  message = <<~EOS.chomp!
    The following #{flag_text}:
      #{flags.join(", ")}
    #{require_text} building tools, but none are installed.
    #{DevelopmentTools.installation_instructions}
  EOS

  message << <<~EOS.chomp! if bottled
    Alternatively, remove the #{flag_text} to attempt bottle installation.
  EOS

  super message
end