diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-06-01 01:43:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 01:43:03 +0300 |
commit | db430a522b7c2fec9a77d6f9443a79750f7b238e (patch) | |
tree | beaa90c181dd508e55a1cfd6c8090fe4070b1965 /src | |
parent | 07da10e1101374c57d3eb40b0239bb317a065d99 (diff) |
Ruby: fix bug (#36)
* fix ruby
* skip rbenv/ruby-build
Diffstat (limited to 'src')
-rw-r--r-- | src/ruby/install.sh | 51 |
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 |