Samruddhikhandale/attempt fix ruby (#38)

* add source

* temp - debug

* ruby: fix sourcing bug
This commit is contained in:
Samruddhi Khandale 2022-06-02 12:01:11 -07:00 committed by GitHub
parent 1da3b0ef10
commit d8581f4936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,15 +226,16 @@ else
# Install rvm # Install rvm
curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles ${RVM_INSTALL_ARGS} --with-default-gems="${DEFAULT_GEMS}" 2>&1 curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles ${RVM_INSTALL_ARGS} --with-default-gems="${DEFAULT_GEMS}" 2>&1
usermod -aG rvm ${USERNAME} usermod -aG rvm ${USERNAME}
su ${USERNAME} -c ". /usr/local/rvm/scripts/rvm && rvm fix-permissions system" source /usr/local/rvm/scripts/rvm
rvm fix-permissions system
rm -rf ${GNUPGHOME} rm -rf ${GNUPGHOME}
fi fi
if [ "${INSTALL_RUBY_TOOLS}" = "true" ]; then if [ "${INSTALL_RUBY_TOOLS}" = "true" ]; then
# Non-root user may not have "gem" in path when script is run and no ruby version # Non-root user may not have "gem" in path when script is run and no ruby version
# is installed by rvm, so handle this by using root's default gem in this case # is installed by rvm, so handle this by using root's default gem in this case
ROOT_GEM='$(which gem || echo "")' ROOT_GEM="$(which gem || echo "")"
su ${USERNAME} -c ". /usr/local/rvm/scripts/rvm && \"$(which gem || echo ${ROOT_GEM})\" install ${DEFAULT_GEMS}" ${ROOT_GEM} install ${DEFAULT_GEMS}
fi fi
# VS Code server usually first in the path, so silence annoying rvm warning (that does not apply) and then source it # VS Code server usually first in the path, so silence annoying rvm warning (that does not apply) and then source it
@ -268,5 +269,7 @@ if [ ${SKIP_RBENV_RBUILD} != "true"] ; then
fi fi
# Clean up # Clean up
su ${USERNAME} -c ". /usr/local/rvm/scripts/rvm && rvm cleanup all && \"$(which gem || echo ${ROOT_GEM})\" cleanup" rvm cleanup all
${ROOT_GEM} cleanup
echo "Done!" echo "Done!"