2020年12月1日火曜日

macOS Big Sur (11.0) で消えた svn (Subversionm) コマンドをインストールする方法

% svn
zsh: command not found: svn

とまぁ、Big Surでは svnがなくなっていました。WordPress プラグインの公式リポジトリにアップするのに svn 使うのでインストールする必要があります。しかしながら、若干苦労したので備忘録としてまとめておきます。

% brew install svn
Warning: You are using macOS 11.0.
We do not provide support for this released but not yet supported version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
released but not yet supported version.

Homebrew は macOS Big Surをクリーンインストールしたあとにインストールしました。まだ対応していないと思って、Xcodeの Command Line Toolsに含まれていないかチェック。

% /Library/Developer/CommandLineTools/usr/bin/svn
zsh: no such file or directory: /Library/Developer/CommandLineTools/usr/bin/svn

% /Applications/Xcode.app/Contents/Developer/usr/bin/svn
zsh: no such file or directory: /Applications/Xcode.app/Contents/Developer/usr/bin/svn

とまぁ存在しない。一応 Command Line Toolsを入れ直してもだめ

% sudo cd /Library/Developer/
% sudo mv CommandLineTools  CommandLineTools.org
% sudo  xcode-select --install

これでも駄目でした。

解決方法

Solve Can't use Subversion command line client:svn in Mac bigsur

の情報を参考に

1. Homebrew を再度インストール(上書き)

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

2. 再度 svnを Homebrewでインストール

% brew install svn

Updating Homebrew...
Warning: You are using macOS 11.0.
We do not provide support for this released but not yet supported version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this

released but not yet supported version.

==> Downloading https://homebrew.bintray.com/bottles/apr-1.7.0.big_sur.bottle.tar.gz

==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/405f8351e003635d34d2a46018

######################################################################## 100.0%

==> Dow

...

Bash completion has been installed to:
/usr/local/etc/bash_completion.d

とまぁ警告はでるものの、subversionに必要なツールやライブラリのBig Sur対応版をインストールしつつ、subversion本体のインストールもできたのでした。

% svn --version 
svn, version 1.14.0 (r1876290)
compiled Nov 15 2020, 00:07:15 on x86_64-apple-darwin20.1.0

ふー、これでインストールできなかったらどうしようかと思いました。やはり持っている端末すべてを人柱OS(出てすぐのOS)にアップグレードするのは駄目ですね (^^;

2020年12月1日 @kimipooh