1: 2019-06-06 (木) 12:10:00 nobuaki  |
現: 2019-06-06 (木) 12:14:23 nobuaki  |
| - | *HomeBrewを [#y6651cc7] | + | *HomeBrewをMacOS X 10.14.4 Mojavaにインストール [#d7a687fd] |
| - | | + | |
| - | **はじめに [#s5afc8ca] | + | **はじめに [#p50ac5bb] |
| - | | + | |
| - | **バージョンの確認. [#wbc08c2e] | + | |
| | | | |
| | + | Yosemite以降,High Sierraまでは同じ手順でインストールができていたが,Mojaveになってから?対応するXcodeがバージョンアップしてから?Xcodeのインストールパスが変更されたようで新規インストールの場合エラーがでて進まない問題がある. |
| | + | この記事では,そのエラーも体験しながら,エラーを解決してインストールを進める. |
| | + | |
| | + | **バージョンの確認. [#b488f4b7] |
| | + | |
| | これからインストールを行う対象のマシンのOSバージョンを確認. | | これからインストールを行う対象のマシンのOSバージョンを確認. |
| | + | |
| | MBA2013:Users ujpadmin$ sw_vers🆑 | | MBA2013:Users ujpadmin$ sw_vers🆑 |
| | ProductName: Mac OS X | | ProductName: Mac OS X |
| | BuildVersion: 18E227 | | BuildVersion: 18E227 |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | macos 10.14なので,通称mojaveというもの. | | macos 10.14なので,通称mojaveというもの. |
| | + | |
| | Xcodeは,あらかじめApp Storeからインストール済み. | | Xcodeは,あらかじめApp Storeからインストール済み. |
| | + | |
| | MBA2013:Users ujpadmin$ xcodebuild -version🆑 | | MBA2013:Users ujpadmin$ xcodebuild -version🆑 |
| | Xcode 10.2.1 | | Xcode 10.2.1 |
| | Build version 10E1001 | | Build version 10E1001 |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | 現時点(2019/06/06)で最新版. | | 現時点(2019/06/06)で最新版. |
| - | | + | |
| - | **HomeBrewをインストールする(失敗する) [#h0372c92] | + | **HomeBrewをインストールする(失敗する) [#id867833] |
| | + | |
| | いつものように公式サイトに記載されている通りに,rubyをインストール. | | いつものように公式サイトに記載されている通りに,rubyをインストール. |
| | + | |
| | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 | | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 |
| | ==> This script will install: | | ==> This script will install: |
| | /usr/local/Homebrew | | /usr/local/Homebrew |
| | ==> The Xcode Command Line Tools will be installed. | | ==> The Xcode Command Line Tools will be installed. |
| | + | |
| | Press RETURN to continue or any other key to abort | | Press RETURN to continue or any other key to abort |
| | + | |
| | インストールを続けるので,リターンキーを押下. | | インストールを続けるので,リターンキーを押下. |
| | + | |
| | ==> Searching online for the Command Line Tools | | ==> Searching online for the Command Line Tools |
| | ==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | | ==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress |
| | Password: | | Password: |
| | + | |
| | Macの開発環境であるXcodeのコマンドラインツールをインストールするので,ログインしているユーザのパスワードを入力.(ユーザアカウントには,管理者権限が必要) | | Macの開発環境であるXcodeのコマンドラインツールをインストールするので,ログインしているユーザのパスワードを入力.(ユーザアカウントには,管理者権限が必要) |
| | + | |
| | ==> Installing the Command Line Tools (expect a GUI popup): | | ==> Installing the Command Line Tools (expect a GUI popup): |
| | ==> /usr/bin/sudo /usr/bin/xcode-select --install | | ==> /usr/bin/sudo /usr/bin/xcode-select --install |
| | xcode-select: note: install requested for command line developer tools | | xcode-select: note: install requested for command line developer tools |
| | Press any key when the installation has completed. | | Press any key when the installation has completed. |
| | + | |
| | 何かキーを押すことで,インストールが始まるというので,リターンキーを押下. | | 何かキーを押すことで,インストールが始まるというので,リターンキーを押下. |
| | + | |
| | ==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools | | ==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools |
| | xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools' | | xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools' |
| | Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools | | Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | エラーがでて失敗.invalid developer directory となっているので,インストール先のディレクトリである/Library/Developer/CommandLineToolsに問題がある模様. | | エラーがでて失敗.invalid developer directory となっているので,インストール先のディレクトリである/Library/Developer/CommandLineToolsに問題がある模様. |
| | + | |
| | コマンドラインで,デベロッパ用のディレクトリを確認. | | コマンドラインで,デベロッパ用のディレクトリを確認. |
| | + | |
| | MBA2013:Users ujpadmin$ /usr/bin/xcode-select -p | | MBA2013:Users ujpadmin$ /usr/bin/xcode-select -p |
| | /Applications/Xcode.app/Contents/Developer | | /Applications/Xcode.app/Contents/Developer |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | ディレクトリが異なる模様. | | ディレクトリが異なる模様. |
| - | | + | |
| - | **Xcodeをスイッチする [#ka74ca31] | + | **Xcodeをスイッチする [#reae00d6] |
| | + | |
| | Xcodeのインストールディレクトリが変更された?ようなので,コマンドラインで切り替える. | | Xcodeのインストールディレクトリが変更された?ようなので,コマンドラインで切り替える. |
| | + | |
| | MBA2013:Users ujpadmin$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer | | MBA2013:Users ujpadmin$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer |
| | Password: | | Password: |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | 切り替えられたことを確認. | | 切り替えられたことを確認. |
| | + | |
| | MBA2013:Users ujpadmin$ xcode-select -p🆑 | | MBA2013:Users ujpadmin$ xcode-select -p🆑 |
| | /Applications/Xcode.app/Contents/Developer | | /Applications/Xcode.app/Contents/Developer |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | 再度,HomeBrewのインストールを行う. | | 再度,HomeBrewのインストールを行う. |
| | + | |
| | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 | | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 |
| | ==> This script will install: | | ==> This script will install: |
| | /usr/local/Homebrew | | /usr/local/Homebrew |
| | ==> The Xcode Command Line Tools will be installed. | | ==> The Xcode Command Line Tools will be installed. |
| | + | |
| | Press RETURN to continue or any other key to abort | | Press RETURN to continue or any other key to abort |
| | ==> Searching online for the Command Line Tools | | ==> Searching online for the Command Line Tools |
| | Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools | | Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | 残念.エラーは変わらず.これは,インストーラがパスをハードコーディングしているから. | | 残念.エラーは変わらず.これは,インストーラがパスをハードコーディングしているから. |
| | 以下のURLにあるスクリプトを確認して見ると... | | 以下のURLにあるスクリプトを確認して見ると... |
| | + | |
| | https://raw.githubusercontent.com/Homebrew/install/master/install | | https://raw.githubusercontent.com/Homebrew/install/master/install |
| | + | |
| | いたるところに/Library/Developer/CommandLineToolsにスイッチするように記載がある... | | いたるところに/Library/Developer/CommandLineToolsにスイッチするように記載がある... |
| - | | + | インストーラを修正するのは恒久的なことを考えたら影響が大きいような気がするので,シンボリックリンクで対応する. |
| - | **/Library/Developer/CommandLineToolsのシンボリックリンクを作成 [#vac3d6b5] | + | |
| | + | **/Library/Developer/CommandLineToolsのシンボリックリンクを作成 [#yb542a1f] |
| | + | |
| | 問題は/Library/Developer/CommandLineToolsがないことなので,最新の/Applications/Xcode.app/Contents/Developerへのシンボリックリンクを作成する. | | 問題は/Library/Developer/CommandLineToolsがないことなので,最新の/Applications/Xcode.app/Contents/Developerへのシンボリックリンクを作成する. |
| | + | |
| | まずは,現在の上位ディレクトリの確認. | | まずは,現在の上位ディレクトリの確認. |
| | + | |
| | MBA2013:Users ujpadmin$ ls -la /Library/Developer🆑 | | MBA2013:Users ujpadmin$ ls -la /Library/Developer🆑 |
| | total 0 | | total 0 |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | ここに,CommandLineToolsのリンクを作成する. | | ここに,CommandLineToolsのリンクを作成する. |
| | + | |
| | MBA2013:Users ujpadmin$ sudo ln -s /Applications/Xcode.app/Contents/Developer /Library/Developer/CommandLineTools🆑 | | MBA2013:Users ujpadmin$ sudo ln -s /Applications/Xcode.app/Contents/Developer /Library/Developer/CommandLineTools🆑 |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | リンクが作成されたか確認する. | | リンクが作成されたか確認する. |
| | + | |
| | MBA2013:Users ujpadmin$ ls -la /Library/Developer🆑 | | MBA2013:Users ujpadmin$ ls -la /Library/Developer🆑 |
| | total 0 | | total 0 |
| | drwxr-xr-x 4 root admin 128 3 13 11:53 PrivateFrameworks | | drwxr-xr-x 4 root admin 128 3 13 11:53 PrivateFrameworks |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | これで,再度インストールを行う. | | これで,再度インストールを行う. |
| - | | + | |
| - | **HomeBrewをインストールする() [#r9590a47] | + | **HomeBrewをインストールする() [#z7920d8b] |
| - | | + | |
| | + | |
| | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 | | MBA2013:Users ujpadmin$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"🆑 |
| | ==> This script will install: | | ==> This script will install: |
| | /usr/local/etc/bash_completion.d/brew | | /usr/local/etc/bash_completion.d/brew |
| | /usr/local/Homebrew | | /usr/local/Homebrew |
| | + | |
| | Press RETURN to continue or any other key to abort🆑 | | Press RETURN to continue or any other key to abort🆑 |
| | ==> Downloading and installing Homebrew... | | ==> Downloading and installing Homebrew... |
| | Already up-to-date. | | Already up-to-date. |
| | ==> Installation successful!🆑 | | ==> Installation successful!🆑 |
| | + | |
| | ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. | | ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. |
| | Read the analytics documentation (and how to opt-out) here: | | Read the analytics documentation (and how to opt-out) here: |
| | https://docs.brew.sh/Analytics | | https://docs.brew.sh/Analytics |
| | + | |
| | ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: | | ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: |
| | https://github.com/Homebrew/brew#donations | | https://github.com/Homebrew/brew#donations |
| | https://docs.brew.sh | | https://docs.brew.sh |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| - | | + | |
| - | **インストール後の確認処理 [#ee547d03] | + | **インストール後の確認処理 [#vca9948c] |
| | + | |
| | brew doctorコマンドで,インストールに問題なかったか確認. | | brew doctorコマンドで,インストールに問題なかったか確認. |
| | + | |
| | MBA2013:Users ujpadmin$ brew doctor🆑 | | MBA2013:Users ujpadmin$ brew doctor🆑 |
| | Your system is ready to brew. | | Your system is ready to brew. |
| | MBA2013:Users ujpadmin$ | | MBA2013:Users ujpadmin$ |
| | + | |
| | 問題ない模様. | | 問題ない模様. |
| | + | |
| | MBA2013:Users ujpadmin$ brew --config🆑 | | MBA2013:Users ujpadmin$ brew --config🆑 |
| | HOMEBREW_VERSION: 2.1.4 | | HOMEBREW_VERSION: 2.1.4 |