From: W. Trevor King Date: Thu, 20 Mar 2014 00:17:09 +0000 (-0700) Subject: .bash_profile: Add ~/.gem/*/bin to the PATH (if they exist) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e8f9e002915b79e7f0eb25efcec97743935bfb11;p=dotfiles-public.git .bash_profile: Add ~/.gem/*/bin to the PATH (if they exist) This allows you to automatically run Ruby gems without tweaking your PATH. --- diff --git a/src/.bash_profile b/src/.bash_profile index a60b37d..2fa9fee 100644 --- a/src/.bash_profile +++ b/src/.bash_profile @@ -3,6 +3,13 @@ # include system binaries PATH="${PATH}":/usr/sbin:/sbin +# set PATH so it includes ruby gems, if they exist +for GEM_BIN in ~/.gem/ruby/*/bin; do + if [ -d "${GEM_BIN}" ]; then + PATH="${GEM_BIN}":"${PATH}" + fi +done + # set PATH so it includes user's local bin if it exists if [ -d "${HOME}"/.local/bin ]; then PATH="${HOME}"/.local/bin:"${PATH}"