rc: add RubyGems to $PATH

via https://wiki.archlinux.org/index.php/ruby#RubyGems
This commit is contained in:
Aminda Suomalainen 2015-04-29 16:58:40 +03:00
parent e7eb3fcba7
commit 38c0722ba3
2 changed files with 10 additions and 0 deletions

View File

@ -189,6 +189,11 @@ fi
# Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$HOME/.local/bin:$HOME/.local/sbin:$HOME/.local/games:$HOME/bin:$HOME/sbin:$HOME/games:/usr/local/bin:/usr/local/sbin:/usr/local/games:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH
# Add RubyGems to PATH
if hash ruby 2>/dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi
# Removes duplicates from $PATH. Copied from http://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')

View File

@ -133,6 +133,11 @@ fi
# Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$HOME/.local/bin:$HOME/.local/sbin:$HOME/.local/games:$HOME/bin:$HOME/sbin:$HOME/games:/usr/local/bin:/usr/local/sbin:/usr/local/games:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH
# Add RubyGems to PATH
if hash ruby 2>/dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi
# Removes duplicates from $PATH. Copied from http://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')