步骤
- 打开终端,输入以下命令并回车:
brew install carthage
- 由于macOS版本为10.12,而最新的carthage需要10.14,所以系统不允许安装,这里需要手动找到github上某个低版本的commit,然后手动安装,步骤如下:
(1)完全卸载carthage:brew uninstall --force carthage
(2)到github上找到对应版本https://github.com/Homebrew/homebrew-core/search?p=2&q=carthage&type=Commits&utf8=✓
(3)假如需要0.29.0,那么找到对应的页面为https://github.com/Homebrew/homebrew-core/commit/df3be3a1882f7d2ea98efac4c9a1f37792b7097b,该版本commit号为df3be3a1882f7d2ea98efac4c9a1f37792b7097b
(4)输入命令手动安装:brew install https://github.com/Homebrew/homebrew-core/raw/df3be3a1882f7d2ea98efac4c9a1f37792b7097b/Formula/carthage.rb
(不同的版本请自行修改commit号)