1/24

*学習内容&時間

スクリーンショット 2021-01-25 5.43.02


*インプットした内容 

HomebrewとXcodeには何かしらの依存関係がある。(自分が使っているCommand Line ToolはVScodeだが、関係がある)故にXcodeを使わなくてもインストールしておかなければならず、容量を圧迫される。。

Apple Developer Apple公式 というサイトが存在する。

*今日やったこと(アウトプット)

ローカル環境に不具合があったのを放置していたため、対処した。

Homebrewのupdateを久々にかけるとこんなエラー。

最新版のCLTをインストール済にもかかわらず、brewに「CLTをUpdateしろ」って怒られる場合の対処法 こちらを参考に対処。

まずHomeBrewの状態を確認。

sk@MacBook-Pro ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Your Command Line Tools are too outdated.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you an update run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.


Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you an update run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.


Warning: Your CLT does not support macOS 11.
It is either outdated or was modified.
Please update your CLT or delete it if no updates are available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you an update run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.


Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/share/man/man1/brew-cask.1

sk@MacBook-Pro ~ % brew --config
HOMEBREW_VERSION: 2.7.5
ORIGIN: https://github.com/Homebrew/brew
HEAD: bca4804a9e48de5319383d3eddadaa7f054c77da
Last commit: 9 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c75a2e0b02247a01cafa248cdb45e0a662e6a0aa
Core tap last commit: 11 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 11.0 build 1100
Git: 2.21.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-x86_64
CLT: 11.0.33.17
Xcode: 12.3

私のmacには以前Xcodeがインストールされていたが、今はアンインストールしたために存在していない。またインストールするしか現状対処しようがないのでやる。先にXcodeのバージョンをAppStoreからダウンロード&インストール。Finderからでいいのでバージョンを確認。

その後Apple Developerを開き、現在のバージョンに合った単体版のCLT(ややこしいが、これはCommand Line Toolsなのであって、PC上にインストールしているVScodeやらのCommand Line Toolのことではない。あしからず。)をダウンロード。見つけにくいので、検索窓にXcodeと入力すると絞れる。

CLTの容量は430MB程度なので安心していい。リストの中にはXcode本体(10GBほど)のダウンロードも表示されているので、お間違えのないように。

その後もう一度brew doctor

sk@MacBook-Pro ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/share/man/man1/brew-cask.1

エラーはほぼ解消されました。

言われたとおりにbrew cleanupする。

sk@MacBook-Pro ~ % brew cleanup
Warning: Skipping icu4c: most recent version 67.1 not installed
Warning: Skipping mysql: most recent version 8.0.23 not installed
Warning: Skipping node: most recent version 15.6.0 not installed
Warning: Skipping openssl@1.1: most recent version 1.1.1i not installed
Removing: /usr/local/Cellar/pkg-config/0.29.2... (11 files, 623KB)
Warning: Skipping protobuf: most recent version 3.14.0 not installed
Removing: /usr/local/Cellar/readline/8.0.4... (48 files, 1.5MB)
Warning: Skipping ruby-build: most recent version 20210119 not installed
Warning: Skipping yarn: most recent version 1.22.10 not installed
Removing: /Users/suzukikohya/Library/Logs/Homebrew/icu4c... (64B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/yarn... (100B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/nodebrew... (104B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/mysql... (799B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/openssl@1.1... (64B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/node... (64B)
Removing: /Users/suzukikohya/Library/Logs/Homebrew/protobuf... (64B)
Pruned 1 symbolic links and 1 directories from /usr/local

sk@MacBook-Pro ~ % brew doctor 
Your system is ready to brew.

デバッグ完了。

なお筆者はXcodeのダウンロードやら、その際のmacの容量不足やら、「じゃあmacのストレージどうなってんの?嗚呼、その他。」やらで非常に時間がかかったので、すんなりとはいかなかったことを補足しておく。

*タスクの進行状況と明日の予定

ローカル環境をどうやらきれいにできそうな感じなので、整えられそうならEC2の環境整備は「アプリを作り終えてから載せる」ぐらいのほうが安心。(またcloud9のように容量の警告が来るのが予見されるため)

もう少しこの辺の模索をする。早くコード書きたい。

*リンク集・参考

Apple Developer Apple公式

この記事が気に入ったらサポートをしてみませんか?