如何使用 Fish shell 设置宝石的路径?

How to set up path for gems with the Fish shell?

如何使用鱼 shell 正确设置宝石路径?

sanoy@nice-system ~/D/c/h/bellevue> gem install bundle

WARNING: You don't have /home/sanoy/.gem/ruby/2.2.0/bin in your PATH, gem executables will not run. Successfully installed bundle-0.0.1 Parsing documentation for bundle-0.0.1 Done installing

documentation for bundle after 0 seconds 1 gem installed

sanoy@nice-system ~/D/c/h/bellevue> bundle install fish: Unknown command 'bundle'

config.fish 文件

set PATH </home/sanoy/.gem/ruby/2.2.0/bin> $PATH

set -gx PATH $PATH </home/sanoy/.gem/ruby/2.2.0/bin>

如评论中所见,在 fish.config 中保留单行可解决问题:

set -gx PATH ~/.gem/ruby/2.2.0/bin $PATH

最好使用基于版本的动态更新路径,特别是如果版本更新没有像 Arch 中那样的发行版更新 Linux

set -U fish_user_paths (ruby -e 'print Gem.user_dir')/bin $fish_user_paths