问题
How do I properly set up path for gems with the Fish 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 file
set PATH </home/sanoy/.gem/ruby/2.2.0/bin> $PATH
set -gx PATH $PATH </home/sanoy/.gem/ruby/2.2.0/bin>
回答1:
As discovered in comments, leaving single line in fish.config
fixes the problem:
set -gx PATH ~/.gem/ruby/2.2.0/bin $PATH
回答2:
It is likely better to use a dynamically updated path based on version, especially if version updates without distro updates like in Arch Linux
set -U fish_user_paths (ruby -e 'print Gem.user_dir')/bin $fish_user_paths
来源:https://stackoverflow.com/questions/31801840/how-to-set-up-path-for-gems-with-the-fish-shell