3

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>
halfer
  • 19,471
  • 17
  • 87
  • 173
sanoy
  • 105
  • 3
  • 9

2 Answers2

7

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
2

As discovered in comments, leaving single line in fish.config fixes the problem:

set -gx PATH ~/.gem/ruby/2.2.0/bin $PATH
EugZol
  • 6,343
  • 19
  • 40