diff --git a/other_software/install_rbenv_and_ruby.sh b/other_software/install_rbenv_and_ruby.sh index feb2932..dac12b7 100644 --- a/other_software/install_rbenv_and_ruby.sh +++ b/other_software/install_rbenv_and_ruby.sh @@ -12,6 +12,11 @@ if ! command -v curl &> /dev/null; then exit 1 fi +if ! command -v make &> /dev/null; then + echo "make is not installed. Please install make first." + exit 1 +fi + if [ ! -d "$HOME/.rbenv" ]; then git clone https://github.com/rbenv/rbenv.git ~/.rbenv cd ~/.rbenv && src/configure && make -C src @@ -36,6 +41,12 @@ fi echo "Fetching latest Ruby versions..." VERSIONS=$(rbenv install -l 2>/dev/null | grep -E "^\s*\d+\.\d+\.\d+$" | tail -n 5) +# Check if VERSIONS is empty +if [ -z "$VERSIONS" ]; then + echo "No Ruby versions found." + exit 1 +fi + # Present the user with options echo "Please select a Ruby version to install:" select VERSION in $VERSIONS; do