aboutsummaryrefslogtreecommitdiff
path: root/src/ruby/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/install.sh')
-rw-r--r--src/ruby/install.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ruby/install.sh b/src/ruby/install.sh
index 7c71282..3d3edbc 100644
--- a/src/ruby/install.sh
+++ b/src/ruby/install.sh
@@ -226,15 +226,16 @@ else
# Install rvm
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}
- 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}
fi
if [ "${INSTALL_RUBY_TOOLS}" = "true" ]; then
# 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
- ROOT_GEM='$(which gem || echo "")'
- su ${USERNAME} -c ". /usr/local/rvm/scripts/rvm && \"$(which gem || echo ${ROOT_GEM})\" install ${DEFAULT_GEMS}"
+ ROOT_GEM="$(which gem || echo "")"
+ ${ROOT_GEM} install ${DEFAULT_GEMS}
fi
# 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
# 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!"