1
0

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 1 year has passed since last update.

【Mac版】fish + anyenv のセットアップ

Last updated at Posted at 2023-10-05

はじめに

macOSにおける「fish + anyenv」のセットアップ手順をまとめます。

プロセッサ:Apple M2
OS: macOS Sonoma 14.0

概要

  • セットアップ
    • Homebrew
    • fish
    • anyenv

セットアップ

Homebrew

未インストールの方は下記手順でHomebrewをインストールします。

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

fish

インストール

Homebrewがインストールできたら、fishをインストールします。

$ brew install fish

デフォルトシェルに設定

パスの確認

$ which fish
/opt/homebrew/bin/fish

M1/M2チップMac と IntelチップMac でパスが異なるため注意してください。
M1/M2:/opt/homebrew/bin/fish
Intel:/usr/local/bin/fish

/etc/shellsに確認したfishのパスを追加

$ sudo vi /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
~~~~~~~~~~~~
/opt/homebrew/bin/fish

デフォルトシェルの変更

$ chsh -s /opt/homebrew/bin/fish

※brew経由で fish をインストールした場合に不具合が起こる可能性があるため、その場合は fish の公式サイトから直接ダウンロード+インストールします。

anyenv

インストール

brew install anyenv

初期化

anyenv init

config 修正

echo 'status --is-interactive; and source (anyenv init -|psub)' >> ~/.config/fish/config.fish

fish リロード

exec $SHELL -l

install manifestsの初期化

anyenv install --init

ここまでできたら、好きなツールをインストールできます。

// nodenvのインストール
anyenv install nodenv

最後に

バージョン管理ツールはそのうち asdf に乗り換えたいと思ってます。
最後まで読んでいただきありがとうございました。

参考記事

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?