File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 "GEM_HOME" : " /usr/local/rvm/gems/default" ,
2525 "MY_RUBY_HOME" : " /usr/local/rvm/rubies/default" ,
2626 "PATH" : " /usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:${PATH}"
27- },
28- "install" : {
29- "app" : " " ,
30- "file" : " install.sh"
3127 }
3228}
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ USERNAME=${USERNAME:-"automatic"}
1313UPDATE_RC=${UPDATE_RC:- " true" }
1414INSTALL_RUBY_TOOLS=${INSTALL_RUBY_TOOLS:- " true" }
1515
16+ # Comma-separated list of ruby versions to be installed (with rvm)
17+ # alongside RUBY_VERSION, but not set as default.
18+ ADDITIONAL_VERSIONS=${ADDITIONAL_VERSIONS:- " " }
19+
1620# Note: ruby-debug-ide will install the right version of debase if missing and
1721# installing debase directly fails on Ruby 3.1.0 as of 1/7/2022, so omitting.
1822DEFAULT_GEMS=" rake ruby-debug-ide"
239243# VS Code server usually first in the path, so silence annoying rvm warning (that does not apply) and then source it
240244updaterc " 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"
241245
246+ # Additional ruby versions to be installed but not be set as default.
247+ if [ ! -z " ${ADDITIONAL_VERSIONS} " ]; then
248+ OLDIFS=$IFS
249+ IFS=" ,"
250+ read -a additional_versions <<< " $ADDITIONAL_VERSIONS"
251+ for version in " ${additional_versions[@]} " ; do
252+ # Figure out correct version of a three part version number is not passed
253+ find_version_from_git_tags version " https://github.com/ruby/ruby" " tags/v" " _"
254+ source /usr/local/rvm/scripts/rvm
255+ rvm install ruby ${version}
256+ done
257+ IFS=$OLDIFS
258+ fi
259+
242260# Install rbenv/ruby-build for good measure
243261if [ " ${SKIP_RBENV_RBUILD} " != " true" ]; then
244262
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # Optional: Import test library
6+ source dev-container-features-test-lib
7+
8+ check " ruby version 3.1.2 installed as default" ruby -v | grep 3.1.2
9+ check " ruby version 2.5.9 installed" rvm list | grep 2.5.9
10+ check " ruby version 3.0.4 installed" rvm list | grep 3.0.4
11+
12+ # Report result
13+ reportResults
Original file line number Diff line number Diff line change 1111 "configure_jupyterlab_allow_origin" : " *"
1212 }
1313 }
14+ },
15+ "install_additional_ruby" : {
16+ "image" : " ubuntu:focal" ,
17+ "features" : {
18+ "ruby" : {
19+ "version" : " 3.1.2" ,
20+ "additional_versions" : " 2.5,3.0.4"
21+ }
22+ }
1423 }
1524}
You can’t perform that action at this time.
0 commit comments