#! /bin/bash # Rocky 9 compatible SCRIPT_NAME="RVM Install" VERSION="1.1.0" . /usr/src/k_framework/main.sh k_start #------VARIABLES------------- FIRST_INSTALL="$1" #----- FUNCTIONS ------------ install_rvm() { # About: This function checks if rvm (ruby version manager) is installed in the system. # # Returns: # 0 - OK # 1 - FAILED if [ ! -f "/usr/local/rvm/scripts/rvm" ]; then #==== yum bug yum clean metadata yum clean all #=============== yum -y install mc bc wget curl make git bzip2 gcc openssl openssl-devel zlib zlib-devel sudo autoconf cd /usr/src report "Downloading RVM install script from https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer" 3 wget -c https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer --no-check-certificate sh rvm-installer stable if [ -f "/usr/local/rvm/scripts/rvm" ]; then report "RVM successfully installed" 0 else report "Failed to install RVM, cannot continue until this problem is fixed. Please fix it manualy" 1 EXIT_CODE=1 k_exit 1 fi #===== else report "RVM already installed" 0 source "/etc/profile.d/rvm.sh" rvm get stable rvm autolibs enable fi } #--------MAIN ------------- gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB # different method if first fails sleep 1 curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - install_rvm source /etc/profile.d/rvm.sh rvm reload k_exit $EXIT_CODE