記事内に広告有

macOS(15.2)SequoiaでMAMP:[Homebrew]の再インストール

iMac

前の記事「“macOS(13.0.1)Ventura”から”macOS(15.1)Sequoia”に移行後のMAMP環境」において、「macOS Ventura」に「Homebrew」経由でインストールした”Apache2.4″と”PHP8.1″が、移行アシスタントにより「旧iMac (Ventura, intel Corei7) 」から「新しいiMac(Sequoia, Apple M4)」に問題無く移行されていることが確認できました。

Homebrew」には、インストール環境に問題がないか、また、問題が見つかった場合にどのような対処をすれば良いかなどを診断してくれる”doctor”コマンドというものがあります。そこで、今回の移行にその他に問題がないかを”brew doctor”で確認したところ『Warning:…』と何やら警告されてしまいました。以下、コマンドの実行結果です。

% 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 Homebrew's prefix is not /opt/homebrew.

Many of Homebrew's bottles (binary packages) can only be used with the default prefix.
Consider uninstalling Homebrew and reinstalling into the default prefix.
It is expected behaviour that some formulae will fail to build in this unsupported configuration.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
%

Google翻訳で和訳してみると以下のような警告でした。

警告: Homebrew のプレフィックスは /opt/homebrew ではありません。
Homebrew のボトル ​​(バイナリ パッケージ) の多くは、デフォルトのプレフィックスでのみ使用できます。
Homebrew をアンインストールし、デフォルトのプレフィックスに再インストールすることを検討してください。
このサポートされていない構成では、一部のフォーミュラがビルドに失敗することが想定されます。
(略)

どうやらHomeBrewのインストール先がデフォルトではないようです。「which brew」コマンドで調べてみると「旧iMac (Ventura, intel Corei7) 」のHomebrewは、「/usr/local/bin/brew」にインストールされていました。移行アシスタントで移行した「新しいiMac(Sequoia, Apple M4)」のHomebrewも「/usr/local/bin/brew」にインストールされていました。Intel MacとApple Silicon Macでは、Homebrewのインストールされるフォルダが異なり、Intel Macでは、「/usr/local/」に、Apple Silicon Macでは、「/opt/homebrew」にインストールされるようです。

“brew doctor”からの警告には、『このサポートされていない構成では、一部のフォーミュラがビルドに失敗することが予想されます。』という記載もあります。実際に、Python(pyenv)のインストールで「BUILD FAILED (OS X 15.2 using python-build 20180424)」となってしまいました。プロセッサーが「intel Corei7」から「Apple M4」に変わるので当然のことなのかもしれません。ここは心機一転!「Homebrew」を再インストールしてMAMP環境を再構築することにしました。まず最初は、[Homebrew]の再インストールです。

Homebrewの再インストール

Homebrewのアンインストール

「brew upgrade」コマンドを実行すると、「brew update –auto-update」コマンドでHomebrewが更新されるのと共に「brew cleanup」コマンドで前バージョンのキャッシュも削除されるようです。不要かなとも思ったのですが、念の為に「brew upgrade」コマンドを実行した後にアンインストールしました。

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)”

% brew upgrade
% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
:
Are you sure you want to uninstall Homebrew? This will remove your installed packages! [y/N]y
:
The following possible Homebrew files were not deleted:
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/include/
/usr/local/lib/
/usr/local/opt/
/usr/local/sbin/
/usr/local/share/
/usr/local/var/
You may wish to remove them yourself.
%

指示『The following possible Homebrew files were not deleted:』に従って不要なファイルを削除しました。

Homebrewのインストール

以下のコマンドでHomebrewをインストールしました。

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks

Press RETURN/ENTER to continue or any other key to abort:
:
==> Next steps:
- Run these commands in your terminal to add Homebrew to your PATH:
    echo >> /Users/myname/.zprofile
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/myname/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh
% echo >> /Users/myname/.zprofile
% echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/myname/.zprofile
% eval "$(/opt/homebrew/bin/brew shellenv)"
% brew doctor
Your system is ready to bre
% brew -v
Homebrew 4.4.11
% which brew
/opt/homebrew/bin/brew
%

以上で、Homebrewのインストールが完了しました。次は、Apacheのインストールです。

macOS(15.2)SequoiaでMAMP:関連記事

コメント

タイトルとURLをコピーしました