-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Description
The Ruby LSP extension fails to start in a Dev Container environment with the error: Automatic Ruby environment activation with custom failed: spawn /bin/bash ENOENT. The extension cannot spawn /bin/bash even though bash exists and is executable at both /bin/bash and /usr/bin/bash.
Environment
- Extension Version:
[email protected] - Editor: Cursor 2.0.77 (VS Code 1.99.3 fork)
- Environment: Dev Container (Docker/OrbStack)
- Ruby Version:
3.3.8(via RVM) - Ruby LSP Gem Version:
0.26.4 - Ruby Version Manager: RVM
- OS: Linux (aarch64, Ubuntu-based container) hosted on MacOS 15.7.2 (Darwin arm64 24.6.0)
Configuration
.devcontainer/devcontainer.json:
{
"name": "AB",
"dockerComposeFile": "compose.yaml",
"service": "ab",
"workspaceFolder": "/workspace",
"containerEnv": {
"BUNDLE_PATH": "/bundle/vendor"
},
"customizations": {
"vscode": {
"extensions": [
"Shopify.ruby-lsp"
],
"settings": {
"rubyLsp.rubyVersionManager": {
"identifier": "rvm"
},
"rubyLsp.bundleGemfile": "${workspaceFolder}/Gemfile",
"rubyLsp.shell": "/bin/bash"
}
}
}
}.vscode/settings.json:
{
"rubyLsp.rubyVersionManager": {
"identifier": "rvm"
},
"rubyLsp.bundleGemfile": "${workspaceFolder}/Gemfile",
"rubyLsp.shell": "/bin/bash",
"rubyLsp.useBundler": true
}Error Message
Automatic Ruby environment activation with custom failed: spawn /bin/bash ENOENT
Ruby LSP Output Logs
2025-11-21 10:46:53.849 [info] (workspace) Running command: `/usr/local/rvm/bin/rvm-auto-ruby -EUTF-8:UTF-8 '/home/vscode/.cursor-server/extensions/shopify.ruby-lsp-0.9.32-universal/activation.rb'` in /workspace/${workspaceFolder} using shell: /bin/bash
Steps to Reproduce
- Set up a Dev Container with RVM and Ruby 3.3.8
- Install Ruby LSP extension (
[email protected]) - Configure extension to use RVM identifier
- Set
rubyLsp.shellto/bin/bash(or/usr/bin/bash) - Reload window or restart Ruby LSP server
- Observe error:
spawn /bin/bash ENOENT
Expected Behavior
The Ruby LSP extension should successfully spawn bash to run the activation script and start the language server.
Actual Behavior
The extension fails with spawn /bin/bash ENOENT error, preventing the language server from starting. This breaks features like "Go to Definition" (Cmd+Click) navigation.
Verification
Bash exists and is executable:
$ ls -la /bin/bash /usr/bin/bash
-rwxr-xr-x 1 root root 1543048 Mar 31 2024 /bin/bash
-rwxr-xr-x 1 root root 1543048 Mar 31 2024 /usr/bin/bash
$ which bash
/usr/bin/bash
$ /bin/bash --version
GNU bash, version 5.2.21(1)-release (aarch64-unknown-linux-gnu)The command the extension is trying to run works when executed manually:
$ /bin/bash -c '/usr/local/rvm/bin/rvm-auto-ruby -EUTF-8:UTF-8 -e "puts \"test\""'
testNode.js can successfully spawn bash:
$ node -e "const {spawn} = require('child_process'); const proc = spawn('/bin/bash', ['--version']); proc.stdout.on('data', d => console.log(d.toString()));"
GNU bash, version 5.2.21(1)-release (aarch64-unknown-linux-gnu)Attempted Solutions
- ✅ Set
rubyLsp.shellto/bin/bashand/usr/bin/bash- no effect - ✅ Configured terminal shell settings - no effect
- ✅ Tried both
customandrvmidentifiers - same error - ✅ Created wrapper scripts - extension still tries to spawn bash
- ✅ Rebuilt Dev Container multiple times - issue persists
- ✅ Verified bash exists and is executable - confirmed
- ✅ Tested manual execution of the command - works fine
Additional Context
- The extension correctly identifies and tries to use
/usr/local/rvm/bin/rvm-auto-ruby - The issue appears to be specifically with how the extension spawns the shell process
- The error occurs even though bash is accessible and executable
- This may be related to the extension running in a restricted context within the Dev Container
- The same configuration works outside of Dev Container (on host machine)
Related Issues
- Unable to activate vscode ruby lsp extension due to failing to globally gem install ruby lsp and other gems #1882 - Gem installation permissions in Docker (different issue)
- Failed to activate Ruby environment: Command failed: (...)\ruby.exe\ruby (...) | The extension treats the Ruby executable path as a directory path #1684 - Ruby executable path issues (may be related)
Workaround
None found. The extension cannot start the language server, so Ruby language features are unavailable in Dev Container.
Request
Please investigate why the extension cannot spawn /bin/bash in Dev Container environments even when bash exists and is executable. This appears to be a bug in how the extension spawns processes in containerized environments.