diff --git a/src/ruby-rails-postgres/.devcontainer/Dockerfile b/src/ruby-rails-postgres/.devcontainer/Dockerfile index dd84a119..096df332 100644 --- a/src/ruby-rails-postgres/.devcontainer/Dockerfile +++ b/src/ruby-rails-postgres/.devcontainer/Dockerfile @@ -1,8 +1,12 @@ -FROM mcr.microsoft.com/devcontainers/ruby:3-${templateOption:imageVariant} +FROM mcr.microsoft.com/devcontainers/ruby:4-${templateOption:imageVariant} # Install Rails RUN su vscode -c "gem install rails webdrivers" -RUN su vscode -c "/usr/local/rvm/bin/rvm fix-permissions" +RUN groupadd --system rubygems \ + && usermod --append --groups rubygems vscode \ + && chgrp -R rubygems "$GEM_HOME" \ + && chmod -R g+rwX "$GEM_HOME" \ + && find "$GEM_HOME" -type d -exec chmod g+s {} + # Default value to allow debug server to serve content over GitHub Codespace's port forwarding service # The value is a comma-separated list of allowed domains diff --git a/src/ruby-rails-postgres/devcontainer-template.json b/src/ruby-rails-postgres/devcontainer-template.json index 0c90e41e..071abe93 100644 --- a/src/ruby-rails-postgres/devcontainer-template.json +++ b/src/ruby-rails-postgres/devcontainer-template.json @@ -1,6 +1,6 @@ { "id": "ruby-rails-postgres", - "version": "6.0.1", + "version": "6.0.2", "name": "Ruby on Rails & Postgres", "description": "Develop Ruby on Rails applications with Postgres. Includes a Rails application container and PostgreSQL server.", "documentationURL": "https://github.com/devcontainers/templates/tree/main/src/ruby-rails-postgres", @@ -11,17 +11,17 @@ "type": "string", "description": "Ruby version (use - trixie, -bookworm, -bullseye variants on local arm64/Apple Silicon):", "proposals": [ - "4-trixie", + "4.0-trixie", "3.4-trixie", "3.3-trixie", - "4-bookworm", + "4.0-bookworm", "3.4-bookworm", "3.3-bookworm", - "3.4-bullseye", + "3.4-bullseye", "3.3-bullseye" ], - "default": "4-trixie" - } + "default": "4.0-trixie" + } }, "platforms": ["Ruby"], "optionalPaths": [ diff --git a/src/ruby/.devcontainer/devcontainer.json b/src/ruby/.devcontainer/devcontainer.json index 3f642645..cf0609c5 100644 --- a/src/ruby/.devcontainer/devcontainer.json +++ b/src/ruby/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Ruby", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/ruby:3-${templateOption:imageVariant}" + "image": "mcr.microsoft.com/devcontainers/ruby:4-${templateOption:imageVariant}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/src/ruby/devcontainer-template.json b/src/ruby/devcontainer-template.json index 3edd7838..8730ce13 100644 --- a/src/ruby/devcontainer-template.json +++ b/src/ruby/devcontainer-template.json @@ -1,6 +1,6 @@ { "id": "ruby", - "version": "6.0.1", + "version": "6.0.2", "name": "Ruby", "description": "Develop Ruby based applications. includes everything you need to get up and running.", "documentationURL": "https://github.com/devcontainers/templates/tree/main/src/ruby", @@ -11,16 +11,16 @@ "type": "string", "description": "Ruby version (use -trixie, -bookworm, -bullseye variants on local arm64/Apple Silicon):", "proposals": [ - "4-trixie", - "3.4-trixie", + "4.0-trixie", + "3.4-trixie", "3.3-trixie", - "4-bookworm", - "3.4-bookworm", + "4.0-bookworm", + "3.4-bookworm", "3.3-bookworm", - "3.4-bullseye", + "3.4-bullseye", "3.3-bullseye" ], - "default": "4-trixie" + "default": "4.0-trixie" } }, "platforms": ["Ruby"], diff --git a/test/ruby-rails-postgres/test.sh b/test/ruby-rails-postgres/test.sh index 99e4d900..f78a9dbe 100755 --- a/test/ruby-rails-postgres/test.sh +++ b/test/ruby-rails-postgres/test.sh @@ -14,8 +14,6 @@ checkCommon # Run devcontainer specific tests check "rails" rails --version check "rails installation path" gem which rails -check "user has write permission to rvm gems" [ -w /usr/local/rvm/gems ] -check "user has write permission to rvm gems default" [ -w /usr/local/rvm/gems/default ] check "user can install gems" gem install github-markup check "gem command works" gem --version check "user can install gems" gem install github-markup diff --git a/test/universal/test.sh b/test/universal/test.sh index 0a89f932..9604fae7 100755 --- a/test/universal/test.sh +++ b/test/universal/test.sh @@ -53,20 +53,19 @@ echo $(echo "java versions" && ls -a /usr/local/sdkman/candidates/java) # Check Ruby tools check "ruby" ruby --version -check "rvm" bash -c ". /usr/local/rvm/scripts/rvm && rvm --version" -check "rbenv" bash -c 'eval "$(rbenv init -)" && rbenv --version' +check "ruby-build" ruby-build --version check "gems" gem --version check "rake" rake --version check "jekyll" jekyll --version -count=$(ls /usr/local/rvm/gems | wc -l) -expectedCount=6 # 2 version folders + 2 global folders for each version + 1 default folder which links to either one of the version + 1 cache folder +check "ruby gems are writable" test -w "$(gem env gemdir)" +count=$(find /usr/local/rubies -mindepth 1 -maxdepth 1 -type d | wc -l) +expectedCount=2 checkVersionCount "two versions of ruby are present" $count $expectedCount -echo $(echo "ruby versions" && ls -a /usr/local/rvm/rubies) +echo $(echo "ruby versions" && ls -a /usr/local/rubies) # Node.js check "node" node --version check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm --version" -check "nvs" bash -c ". /usr/local/nvs/nvs.sh && nvs --version" check "yarn" yarn --version check "npm" npm --version count=$(ls /usr/local/share/nvm/versions/node | wc -l)