LoginSignup
6
4

More than 3 years have passed since last update.

fish3.1.0でpyenvの初期化失敗の対処方法

Posted at

tl;dr

~/.config/fish/config.fish のpyenv(rbenv)の行を以下の用に変更すると問題が起きなくなります。

before

. (pyenv init - | psub)
. (rbenv init - | psub)

after

source (pyenv init - | psub)
source (rbenv init - | psub)

発生する問題

fish3.0.2までは . コマンドを使うことができたのですが、どうやら fish3.1.0から使うことができなくなったようです。
これは元から予告されていたこと ではありますが、

. (a single period) is an alias for the source command. The use of . is deprecated in favour of source, and . will be removed in a future version of fish.

ついになくなってしまったんですね(泣)

bash系のコマンドを使っていたり、 . コマンドをなんとなく使っていたという方はこれを機に設定ファイルを見直す必要があります。

pyenv(rbenv)の初期化の構文でも . コマンドを使うことが一般的ですが、fish3.1.0で動かすと以下のようにエラーメッセージが発生してしまいます。

source: Error encountered while sourcing file '/var/folders/yv/0npp741974sgp79671hf_48c0000gn/T//.psub.pxGqFIeIaF':
source: No such file or directory
source: Error encountered while sourcing file '/var/folders/yv/0npp741974sgp79671hf_48c0000gn/T//.psub.VyHOD74WrY':
source: No such file or directory

終わりに

このようなエラーが出たら冒頭で紹介した通り、 source コマンドを使うようにすれば問題なく動くようになります。
僕も今朝この問題に悩まされたので、他に困っている方がいたら参考にしてください〜〜

6
4
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
6
4