Contact Info

  • aniuma OÜ Harju maakond, Tallinn, Lasnamäe linnaosa, Sepapaja tn 6, 15551

Fish shell で anyenv を使う時のパス設定

Fish shell でanyenvを使うときのパス情報です。 下記を.config/fish/config.fish 内に記述し再起動することでanyenvを経由したrbenv や nodenv, phpenv を使うことができます。
set -x PATH $HOME/.anyenv/bin $PATH
# eval (anyenv init – fish) # not working…
# rbenv
set -x RBENV_ROOT "$HOME/.anyenv/envs/rbenv"
set -x PATH $PATH "$RBENV_ROOT/bin"
set -gx PATH "$RBENV_ROOT/shims" $PATH
set -gx RBENV_SHELL fish
source "$RBENV_ROOT/libexec/../completions/rbenv.fish"
command rbenv rehash 2>/dev/null
function rbenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
source (rbenv "sh-$command" $argv|psub)
case '*'
command rbenv "$command" $argv
end
end
# ndenv
set -x NDENV_ROOT "$HOME/.anyenv/envs/ndenv"
set -x PATH $PATH "$NDENV_ROOT/bin"
set -gx PATH "$NDENV_ROOT/shims" $PATH
set -gx NDENV_SHELL fish
command ndenv rehash 2>/dev/null
function ndenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
eval (ndenv sh"$command" $argv|psub)
case '*'
command ndenv "$command" $argv
end
end
# goenv
set -x GOENV_ROOT "$HOME/.anyenv/envs/goenv"
set -x PATH $PATH "$GOENV_ROOT/bin"
set -gx PATH "$GOENV_ROOT/shims" $PATH
set -gx GOENV_SHELL fish
source "$GOENV_ROOT/libexec/../completions/goenv.fish"
command goenv rehash 2>/dev/null
function goenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
source (goenv "sh-$command" $argv|psub)
case '*'
command goenv "$command" $argv
end
end
view raw anyenv.fish hosted with ❤ by GitHub
fish and anyenv(rbenv, ndenv, goenv) : https://gist.github.com/patorash/b5a1033c08d2c4df103457866b2dcaa2
パス情報を記述したあとに which php や which ruby でどのパスが通っているのかの確認も忘れないように!
https://hi120ki.github.io/blog/posts/20190125/
https://scrapbox.io/makinoshi/fish%E3%81%A7anyenv%E3%82%92%E4%BD%BF%E3%81%86