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.sh51
1 files changed, 27 insertions, 24 deletions
diff --git a/src/ruby/install.sh b/src/ruby/install.sh
index 9908510..e13158d 100644
--- a/src/ruby/install.sh
+++ b/src/ruby/install.sh
@@ -192,13 +192,14 @@ fi
find_version_from_git_tags RUBY_VERSION "https://github.com/ruby/ruby" "tags/v" "_"
# Just install Ruby if RVM already installed
-if [ -d "/usr/local/rvm" ]; then
+if [ rvm --version != ""]; then
echo "Ruby Version Manager already exists."
if [ "${RUBY_VERSION}" != "none" ]; then
echo "Installing specified Ruby version."
- su ${USERNAME} -c "&& rvm install ruby ${RUBY_VERSION}"
+ su ${USERNAME} -c "rvm install ruby ${RUBY_VERSION}"
fi
SKIP_GEM_INSTALL="false"
+ SKIP_RBENV_RBUILD="true"
else
# Install RVM
receive_gpg_keys RVM_GPG_KEYS
@@ -240,28 +241,30 @@ 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"
# Install rbenv/ruby-build for good measure
-git clone --depth=1 \
- -c core.eol=lf \
- -c core.autocrlf=false \
- -c fsck.zeroPaddedFilemode=ignore \
- -c fetch.fsck.zeroPaddedFilemode=ignore \
- -c receive.fsck.zeroPaddedFilemode=ignore \
- https://github.com/rbenv/rbenv.git /usr/local/share/rbenv
-ln -s /usr/local/share/rbenv/bin/rbenv /usr/local/bin
-updaterc 'eval "$(rbenv init -)"'
-git clone --depth=1 \
- -c core.eol=lf \
- -c core.autocrlf=false \
- -c fsck.zeroPaddedFilemode=ignore \
- -c fetch.fsck.zeroPaddedFilemode=ignore \
- -c receive.fsck.zeroPaddedFilemode=ignore \
- https://github.com/rbenv/ruby-build.git /usr/local/share/ruby-build
-mkdir -p /root/.rbenv/plugins
-ln -s /usr/local/share/ruby-build /root/.rbenv/plugins/ruby-build
-if [ "${USERNAME}" != "root" ]; then
- mkdir -p /home/${USERNAME}/.rbenv/plugins
- chown -R ${USERNAME} /home/${USERNAME}/.rbenv
- ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build
+if [ ${SKIP_RBENV_RBUILD} != "true"] ; then
+ git clone --depth=1 \
+ -c core.eol=lf \
+ -c core.autocrlf=false \
+ -c fsck.zeroPaddedFilemode=ignore \
+ -c fetch.fsck.zeroPaddedFilemode=ignore \
+ -c receive.fsck.zeroPaddedFilemode=ignore \
+ https://github.com/rbenv/rbenv.git /usr/local/share/rbenv
+ ln -s /usr/local/share/rbenv/bin/rbenv /usr/local/bin
+ updaterc 'eval "$(rbenv init -)"'
+ git clone --depth=1 \
+ -c core.eol=lf \
+ -c core.autocrlf=false \
+ -c fsck.zeroPaddedFilemode=ignore \
+ -c fetch.fsck.zeroPaddedFilemode=ignore \
+ -c receive.fsck.zeroPaddedFilemode=ignore \
+ https://github.com/rbenv/ruby-build.git /usr/local/share/ruby-build
+ mkdir -p /root/.rbenv/plugins
+ ln -s /usr/local/share/ruby-build /root/.rbenv/plugins/ruby-build
+ if [ "${USERNAME}" != "root" ]; then
+ mkdir -p /home/${USERNAME}/.rbenv/plugins
+ chown -R ${USERNAME} /home/${USERNAME}/.rbenv
+ ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build
+ fi
fi
# Clean up