Ruby: fix bug (#36)

* fix ruby

* skip rbenv/ruby-build
This commit is contained in:
Samruddhi Khandale 2022-05-31 15:43:03 -07:00 committed by GitHub
parent 07da10e110
commit db430a522b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,13 +192,14 @@ fi
find_version_from_git_tags RUBY_VERSION "https://github.com/ruby/ruby" "tags/v" "_" find_version_from_git_tags RUBY_VERSION "https://github.com/ruby/ruby" "tags/v" "_"
# Just install Ruby if RVM already installed # Just install Ruby if RVM already installed
if [ -d "/usr/local/rvm" ]; then if [ rvm --version != ""]; then
echo "Ruby Version Manager already exists." echo "Ruby Version Manager already exists."
if [ "${RUBY_VERSION}" != "none" ]; then if [ "${RUBY_VERSION}" != "none" ]; then
echo "Installing specified Ruby version." echo "Installing specified Ruby version."
su ${USERNAME} -c "&& rvm install ruby ${RUBY_VERSION}" su ${USERNAME} -c "rvm install ruby ${RUBY_VERSION}"
fi fi
SKIP_GEM_INSTALL="false" SKIP_GEM_INSTALL="false"
SKIP_RBENV_RBUILD="true"
else else
# Install RVM # Install RVM
receive_gpg_keys RVM_GPG_KEYS receive_gpg_keys RVM_GPG_KEYS
@ -240,6 +241,7 @@ fi
updaterc "if ! grep rvm_silence_path_mismatch_check_flag \$HOME/.rvmrc > /dev/null 2>&1; then echo 'rvm_silence_path_mismatch_check_flag=1' >> \$HOME/.rvmrc; fi\nsource /usr/local/rvm/scripts/rvm > /dev/null 2>&1" updaterc "if ! grep rvm_silence_path_mismatch_check_flag \$HOME/.rvmrc > /dev/null 2>&1; then echo 'rvm_silence_path_mismatch_check_flag=1' >> \$HOME/.rvmrc; fi\nsource /usr/local/rvm/scripts/rvm > /dev/null 2>&1"
# Install rbenv/ruby-build for good measure # Install rbenv/ruby-build for good measure
if [ ${SKIP_RBENV_RBUILD} != "true"] ; then
git clone --depth=1 \ git clone --depth=1 \
-c core.eol=lf \ -c core.eol=lf \
-c core.autocrlf=false \ -c core.autocrlf=false \
@ -263,6 +265,7 @@ if [ "${USERNAME}" != "root" ]; then
chown -R ${USERNAME} /home/${USERNAME}/.rbenv chown -R ${USERNAME} /home/${USERNAME}/.rbenv
ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build
fi fi
fi
# Clean up # Clean up
source /usr/local/rvm/scripts/rvm source /usr/local/rvm/scripts/rvm