Cannot install brew on Mojave with Xcode 10

后端 未结 7 1649
野的像风
野的像风 2021-01-31 04:20

I can not install any brew packages on my mac with the following error info.

Installed on my Mac:

  • macOS 10.14 Beta (18A293u)
相关标签:
7条回答
  • 2021-01-31 04:46

    You will need to install both "Xcode 10.0 Beta" from https://developer.apple.com/download/ AND "Command Line Tools (macOS 10.14) for Xcode 10 Beta" from

    https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.14_for_Xcode_10/Command_Line_Tools_macOS_10.14_for_Xcode_10.dmg

    Update contributed by other comments, after you installed "Command Line Tools", you will also need to execute the following command in your terminal.

    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
    
    0 讨论(0)
  • 2021-01-31 04:50

    At this time, Brew is not supporting macOS Mojave Beta.

    (Type brew doctor to confirm that they are not accepting issues for Mojave yet)

    See: https://apple.stackexchange.com/questions/327458/install-homebrew-packages-on-macos-mojave-beta

    See: https://github.com/Homebrew/brew/issues/4295

    0 讨论(0)
  • 2021-01-31 04:52

    Beginning in 10.14, a new step is required to create the header files in /usr/include:

    Install /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

    Source: The Xcode 10 release notes

    0 讨论(0)
  • 2021-01-31 04:52

    After installing CLT, you can ask CLT to add header files to /usr/include, then homebrew will appropriate detect the Command Line Tools.

    installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
    
    0 讨论(0)
  • 2021-01-31 04:52

    I was able to install Homebrew on Mojave by manually downloading the command line tools here: https://developer.apple.com/download/more/

    Modify the Homebrew install script here: https://raw.githubusercontent.com/Homebrew/install/master/install

    By replacing:

    def should_install_command_line_tools?
      return false if force_curl?
      return false if macos_version < "10.9"
      !File.exist?("/Library/Developer/CommandLineTools/usr/bin/git") ||
      !File.exist?("/usr/include/iconv.h")
    end
    

    With this:

    def should_install_command_line_tools?
      return true
    end
    

    Then just execute the script.

    This is a little hacky, but it worked for me and could help someone out in the beta period.

    0 讨论(0)
  • 2021-01-31 05:04

    After installing Xcode 10 Beta and Command Line Tools (macOS 10.14) for Xcode 10 Beta, I also changed the path for xcode-select to use the newly installed command line tools with:

    sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer     
    
    0 讨论(0)
提交回复
热议问题