You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert workaround from rails#55182 and update to latest devcontainer image
This commit updates the devcontainer image to ghcr.io/rails/devcontainer/images/ruby:3.4.4 ,
reflecting the latest version from rails/[email protected].
It also reverts the temporary workaround introduced in rails#55182, which used an older image to avoid issues caused by the transition from rbenv to mise.
- With this commit
```
vscode ➜ /workspaces/rails (use_mise_in_devcontainer) $ ruby -v
ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [aarch64-linux]
vscode ➜ /workspaces/rails (use_mise_in_devcontainer) $ which ruby
/home/vscode/.local/share/mise/installs/ruby/3.4.4/bin/ruby
vscode ➜ /workspaces/rails (use_mise_in_devcontainer) $
```
In the updated image, Ruby is no longer installed via rbenv, so /home/vscode/.rbenv/shims/bundle no longer exists.
- Using `ghcr.io/rails/devcontainer/images/ruby:3.4.4` image without changing the path to bundler
```
=> ERROR [dev_container_auto_added_stage_label 19/19] RUN cd /tmp/rails 0.1s
------
> [dev_container_auto_added_stage_label 19/19] RUN cd /tmp/rails && /home/vscode/.rbenv/shims/bundle install && rm -rf /tmp/rails:
0.127 /bin/sh: 1: /home/vscode/.rbenv/shims/bundle: not found
------
```
Rather than hard-coding a mise-specific path, this change runs bundle install in an interactive Bash shell (bash -i -c)
to ensure that mise’s environment setup in ~/.bashrc is applied.
This avoids introducing a direct dependency on mise internals
and ensures compatibility with future changes to the Ruby installation mechanism.
By default, Docker’s RUN instruction uses the shell form ["/bin/sh", "-c"], as documented in the Dockerfile reference.
https://docs.docker.com/reference/dockerfile/#shell
> The default shell on Linux is ["/bin/sh", "-c"],
This shell does not source ~/.bashrc, so any environment configuration added by mise would be ignored.
To address this, bash -i -c is explicitly used to invoke an interactive shell.
According to the GNU Bash manual, interactive non-login shells source ~/.bashrc by default.
https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files
> Invoked as an interactive non-login shell
> When an interactive shell that is not a login shell is started,
> Bash reads and executes commands from ~/.bashrc, if that file exists.
0 commit comments