From e8f9e002915b79e7f0eb25efcec97743935bfb11 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Mar 2014 17:17:09 -0700 Subject: [PATCH] .bash_profile: Add ~/.gem/*/bin to the PATH (if they exist) This allows you to automatically run Ruby gems without tweaking your PATH. --- src/.bash_profile | 7 +++++++ 1 file changed, 7 insertions(+) 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}" -- 2.26.2