fishでrbenvを使う
Ubuntuでfishを使っていて、rbenvの初期処理を実行する際に、詰まったので備忘録を残す。
最初に以下の記事を見つけて、config.fishを変更した。
設定内容はこれ。
togattti@dev ~> cat ~/.config/fish/config.fish rbenv init - | source
でも、ログインし直したら、エラーが出た。
'case' builtin not inside of switch block - (line 10): case "$command" in ^ from sourcing file - called on line 1 of file ~/.config/fish/config.fish from sourcing file ~/.config/fish/config.fish called during startup
rbenvは、1.1.1だから、そこまで古くないのだけど。。
とりあえず、Issueを見つけたので、以下のように設定を変更して、反映させた。
togattti@dev ~> cat ~/.config/fish/config.fish if status –is-interactive set PATH $HOME/.rbenv/bin $PATH . (rbenv init - | psub) end
参考
. (rbenv init -|psub) breaks fish shell executable files · Issue #501 · rbenv/rbenv · GitHub