簡體   English   中英

無法使用Xcode 10在Mojave上安裝brew

[英]Cannot install brew on Mojave with Xcode 10

我無法使用以下錯誤信息在我的Mac上安裝任何brew包。

安裝在我的Mac上:

  • macOS 10.14 Beta(18A293u)
  • Xcode 9.3(9E145)
  • Xcode 10.0 beta(10L176w)

輸入brew install xxx 輸出是:

Error: Your Xcode (9.3) is too outdated.
Please update to Xcode 10.0 (or delete it).
Xcode can be updated from
https://developer.apple.com/download/more/

Error: Xcode alone is not sufficient on Mojave.
Install the Command Line Tools:
xcode-select --install

但是當我輸入xcode-select --install ,它說它不可用
Xcode選擇安裝錯誤

我的Mac上兩個版本的Xcode的路徑:

/Applications/Xcode-beta.app
/Applications/Xcode.app

我的配置輸出:
xcode-select -p

/Applications/Xcode.app/Contents/Developer     

brew配置

HOMEBREW_VERSION: 1.6.7
ORIGIN: https://github.com/Homebrew/brew
HEAD: 22e9fd772926e389e264cfb328c3d810b06759f9
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 854bb90b366169915849fc9a83e941b8883cea1f
Core tap last commit: 6 hours ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.6 =>./System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.1 build 902
Git: 2.15.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_131
macOS: 10.14-x86_64
CLT: N/A
Xcode: 9.3
XQuartz: N/A

您需要安裝來自https://developer.apple.com/download/的Xcode 10.0 BetaXcode 10 Beta的命令行工具(macOS 10.14)

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

其他注釋所做的更新,安裝“命令行工具”后,您還需要在終端中執行以下命令。

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

從10.14開始,在/ usr / include中創建頭文件需要一個新步驟:

安裝/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

來源: Xcode 10發行說明

安裝CLT后,您可以要求CLT將頭文件添加到/usr/include ,然后自制軟件將適當檢測命令行工具。

installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

在為Xcode 10 Beta安裝Xcode 10 Beta命令行工具(macOS 10.14)后 ,我還更改了xcode-select的路徑,以便使用新安裝的命令行工具:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer     

目前,Brew不支持macOS Mojave Beta。

(輸入brew doctor確認他們還沒有接受Mojave的問題)

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

請參閱: https//github.com/Homebrew/brew/issues/4295

我可以通過手動下載命令行工具在Mojave上安裝Homebrew: https//developer.apple.com/download/more/

在此處修改Homebrew安裝腳本: https//raw.githubusercontent.com/Homebrew/install/master/install

通過替換:

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

有了這個:

def should_install_command_line_tools?
  return true
end

然后只需執行腳本。

這有點hacky,但它對我有用,可以在測試期間幫助某人。

確認10.14的命令行工具不會創建/usr/include/文件夾,這使得brew安裝腳本堅持重新下載並安裝CL。

下載腳本,手動刪除檢查工作正常。 (要知道它應該是假的而不是真的

def should_install_command_line_tools?
  return **false**
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM