Skip to content

Commit

Permalink
Fix setup.sh so that it correctly checks for rbenv (ianyh#1198)
Browse files Browse the repository at this point in the history
  • Loading branch information
gplusplus314 authored Feb 11, 2022
1 parent 7a33529 commit 78bdccd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fi

# Check for installed ruby version
printf "Checking for rbenv: "
if rbenv version >/dev/null 2>&1 ; then
which rbenv >/dev/null 2>&1
if [ $? -eq 0 ]; then
printf "found!\n"
printf "Ensuring correct ruby version ($OUR_RUBY) is installed:\n"
rbenv install -s $OUR_RUBY
Expand All @@ -26,10 +27,10 @@ else
printf "nope!\n"
ACTUAL=`ruby -v | awk '{print $2}' | awk -Fp '{print $1}' | tr -d '\n'`
if [ $ACTUAL = $OUR_RUBY ] ; then
printf "Correct ruby version is already installed, without rbenv\n"
printf "Correct ruby version is already installed, without rbenv\n"
else
printf "WARNING: You have ruby $ACTUAL, we want ruby $EXPECTED, and rbenv is not installed.\n"
printf "If you encounter setup problems, Try running:\n\tbrew install rbenv\n"
printf "WARNING: You have ruby $ACTUAL, we want ruby $EXPECTED, and rbenv is not installed.\n"
printf "If you encounter setup problems, Try running:\n\tbrew install rbenv\n"
fi
fi

Expand Down

0 comments on commit 78bdccd

Please sign in to comment.