Skip to content

Commit c05bd45

Browse files
authored
[ruby] - Fixing ruby feature installation issue in debian trixie(13) (#1453)
* [ruby] - Making ruby feature work in debian trixie(13) * Restart test
1 parent da45251 commit c05bd45

File tree

6 files changed

+99
-3
lines changed

6 files changed

+99
-3
lines changed

src/ruby/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "ruby",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"name": "Ruby (via rvm)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/ruby",
66
"description": "Installs Ruby, rvm, rbenv, common Ruby utilities, and needed dependencies.",

src/ruby/install.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,29 @@ if [ "${architecture}" != "amd64" ] && [ "${architecture}" != "x86_64" ] && [ "$
240240
fi
241241

242242
# Install dependencies
243-
check_packages curl ca-certificates software-properties-common build-essential gnupg2 libreadline-dev \
243+
# Removed software-properties-common package from here as it has been removed for debian trixie(13)
244+
check_packages curl ca-certificates build-essential gnupg2 libreadline-dev \
244245
procps dirmngr gawk autoconf automake bison libffi-dev libgdbm-dev libncurses5-dev \
245246
libsqlite3-dev libtool libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libssl-dev
246247
if ! type git > /dev/null 2>&1; then
247248
check_packages git
248249
fi
249250

251+
# Conditionally install software-properties-common (skip on Debian Trixie)
252+
if type apt-get >/dev/null 2>&1; then
253+
if [ -f /etc/os-release ]; then
254+
. /etc/os-release
255+
if [ "${ID}" = "debian" ] && [ "${VERSION_CODENAME}" = "trixie" ]; then
256+
echo "Skipping software-properties-common on Debian Trixie."
257+
else
258+
check_packages software-properties-common
259+
fi
260+
else
261+
# Fallback for apt-based systems without /etc/os-release
262+
check_packages software-properties-common
263+
fi
264+
fi
265+
250266
# Function to fetch the version released prior to the latest version
251267
get_previous_version() {
252268
local url=$1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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.4.2 installed as default" ruby -v | grep 3.4.2
9+
check "ruby version 3.2.8 installed" rvm list | grep 3.2.8
10+
check "ruby version 3.3.2 installed" rvm list | grep 3.3.2
11+
12+
check "rbenv" bash -c 'eval "$(rbenv init -)" && rbenv --version'
13+
check "rake" bash -c "gem list | grep rake"
14+
15+
# Report result
16+
reportResults
17+

test/ruby/install_ruby_trixie_base.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "ruby version" ruby --version
10+
check "rvm" rvm --version
11+
check "gem version" gem --version
12+
13+
# Report result
14+
reportResults
15+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.4, 3.3, 3.2, 3-bookworm, 3.4-bookworm, 3.3-bookworm, 3.2-bookworm, 3-bullseye, 3.4-bullseye, 3.3-bullseye, 3.2-bullseye, 3-buster, 3.2-buster
2+
ARG VARIANT=3-trixie
3+
FROM ruby:${VARIANT}
4+
5+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
7+
&& apt-get purge -y imagemagick imagemagick-6-common
8+
9+
# [Optional] Uncomment this section to install additional OS packages.
10+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
11+
# && apt-get -y install --no-install-recommends <your-package-list-here>
12+
13+
# [Optional] Uncomment this line to install additional gems.
14+
# RUN gem install <your-gem-names-here>
15+
16+
# [Optional] Uncomment this line to install global node packages.
17+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
18+

test/ruby/scenarios.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1-
{
1+
{
2+
"install_ruby_trixie_base": {
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/common-utils:2": {
8+
"installZsh": "true",
9+
"username": "vscode",
10+
"userUid": "1000",
11+
"userGid": "1000",
12+
"upgradePackages": "true"
13+
},
14+
"ruby": "none",
15+
"ghcr.io/devcontainers/features/node:1": "none",
16+
"ghcr.io/devcontainers/features/git:1": {
17+
"version": "latest",
18+
"ppa": "false"
19+
}
20+
},
21+
"remoteUser": "vscode"
22+
},
23+
"install_additional_ruby_trixie": {
24+
"image": "debian:trixie",
25+
"features": {
26+
"ruby": {
27+
"version": "3.4.2",
28+
"additionalVersions": "3.2,3.3.2"
29+
}
30+
}
31+
},
232
"install_additional_ruby": {
333
"image": "ubuntu:noble",
434
"features": {

0 commit comments

Comments
 (0)