3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1に移行したらiTermが使えなくなった

Last updated at Posted at 2021-03-15

m1のmacminiに移行したら,iTermが使えなくなった.

そこで,色々調べて解決できたのでメモとして

前提として,
今回の内容は使っているシェルなどによるエラーかもしれないので,全ての人に当てはまるわけでないです.

また,私の使っているシェルはzshです.zsh以外の人は同じ方法でエラーが解消するかわかりません.

エラー内容

移行後,iTermを開いたら,ポップアップが表示され,雑に答えたところ,すぐにiTermが閉じてしまうようになってしまった.

そこで,標準のアプリであるターミナルからの復旧を試みるが,プロセスを完了しましたと表示され,コマンドを入力できない.

やったこと

https://bacchi.me/mac/terminal-troubleshoot/
(この処理は実際にはしなくても良いかもしれないが載せておく)
この記事を参考に/bin/shで起動し,

mv .bash_profile .bash_profile_`/bin/date +%F`

を実行する.(この処理は実際にはしなくても良いかもしれない)
ここで,dateと+%Fの間に半角スペースがあるので注意

そして,

brew install zsh

をする.

上記のサイトではこれで上手くいっていたが,さらなるエラーが生じた.

さらなるエラー

エラー内容

/usr/local/Homebrew/Library/Homebrew/brew.sh: line 670: /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Bad CPU type in executable
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 670: /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Undefined error: 0
Error: 'git' must be installed and in your PATH!
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 670: /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Bad CPU type in executable
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 670: /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Undefined error: 0

したこと

https://himariweb.com/program/homebrew-install-git/
このサイトを参考にCommandLineTools(CLT)を入れ直す.

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcode-select -r
brew install git

これらのコマンドでCLTを入れ直し,gitを再度インストールする.

その後は,エラーなどが出るが,

Error: git 2.23.0_1 is already installed
To upgrade to 2.30.2, run:
  brew upgrade git

とかのバージョン関係のエラーなので指示に従っていく.

以上のことをして,

brew install zsh

または

brew reinstall zsh

により,zshをインストールできるようになった.

そして,iTermを開いたらこれまで通りちゃんと動くようになってくれていた.

3
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?