ruby: install additional versions (#57)
* ruby: install additional versions * nit: fixing spelling Co-authored-by: Josh Spicer <joshspicer@github.com>
This commit is contained in:
parent
6eab72c681
commit
69cba4ffad
4 changed files with 40 additions and 4 deletions
|
@ -24,9 +24,5 @@
|
||||||
"GEM_HOME": "/usr/local/rvm/gems/default",
|
"GEM_HOME": "/usr/local/rvm/gems/default",
|
||||||
"MY_RUBY_HOME": "/usr/local/rvm/rubies/default",
|
"MY_RUBY_HOME": "/usr/local/rvm/rubies/default",
|
||||||
"PATH": "/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:${PATH}"
|
"PATH": "/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:${PATH}"
|
||||||
},
|
|
||||||
"install": {
|
|
||||||
"app": "",
|
|
||||||
"file": "install.sh"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,6 +13,10 @@ USERNAME=${USERNAME:-"automatic"}
|
||||||
UPDATE_RC=${UPDATE_RC:-"true"}
|
UPDATE_RC=${UPDATE_RC:-"true"}
|
||||||
INSTALL_RUBY_TOOLS=${INSTALL_RUBY_TOOLS:-"true"}
|
INSTALL_RUBY_TOOLS=${INSTALL_RUBY_TOOLS:-"true"}
|
||||||
|
|
||||||
|
# Comma-separated list of ruby versions to be installed (with rvm)
|
||||||
|
# alongside RUBY_VERSION, but not set as default.
|
||||||
|
ADDITIONAL_VERSIONS=${ADDITIONAL_VERSIONS:-""}
|
||||||
|
|
||||||
# Note: ruby-debug-ide will install the right version of debase if missing and
|
# Note: ruby-debug-ide will install the right version of debase if missing and
|
||||||
# installing debase directly fails on Ruby 3.1.0 as of 1/7/2022, so omitting.
|
# installing debase directly fails on Ruby 3.1.0 as of 1/7/2022, so omitting.
|
||||||
DEFAULT_GEMS="rake ruby-debug-ide"
|
DEFAULT_GEMS="rake ruby-debug-ide"
|
||||||
|
@ -239,6 +243,20 @@ 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
|
||||||
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"
|
||||||
|
|
||||||
|
# Additional ruby versions to be installed but not be set as default.
|
||||||
|
if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
|
||||||
|
OLDIFS=$IFS
|
||||||
|
IFS=","
|
||||||
|
read -a additional_versions <<< "$ADDITIONAL_VERSIONS"
|
||||||
|
for version in "${additional_versions[@]}"; do
|
||||||
|
# Figure out correct version of a three part version number is not passed
|
||||||
|
find_version_from_git_tags version "https://github.com/ruby/ruby" "tags/v" "_"
|
||||||
|
source /usr/local/rvm/scripts/rvm
|
||||||
|
rvm install ruby ${version}
|
||||||
|
done
|
||||||
|
IFS=$OLDIFS
|
||||||
|
fi
|
||||||
|
|
||||||
# Install rbenv/ruby-build for good measure
|
# Install rbenv/ruby-build for good measure
|
||||||
if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then
|
if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then
|
||||||
|
|
||||||
|
|
13
test-scenarios/install_additional_ruby.sh
Normal file
13
test-scenarios/install_additional_ruby.sh
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Optional: Import test library
|
||||||
|
source dev-container-features-test-lib
|
||||||
|
|
||||||
|
check "ruby version 3.1.2 installed as default" ruby -v | grep 3.1.2
|
||||||
|
check "ruby version 2.5.9 installed" rvm list | grep 2.5.9
|
||||||
|
check "ruby version 3.0.4 installed" rvm list | grep 3.0.4
|
||||||
|
|
||||||
|
# Report result
|
||||||
|
reportResults
|
|
@ -11,5 +11,14 @@
|
||||||
"configure_jupyterlab_allow_origin": "*"
|
"configure_jupyterlab_allow_origin": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"install_additional_ruby": {
|
||||||
|
"image": "ubuntu:focal",
|
||||||
|
"features": {
|
||||||
|
"ruby": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"additional_versions": "2.5,3.0.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue