Commit 63eb48f
authored
## Description
This change adds a working dir field to the Gemset struct and passes
this directory as the `RBENV_DIR` environment variable when executing
gem commands. This ensures that `rbenv` uses the project's directory
when resolving Ruby versions.
## Details
The Ruby extension uses `zed::Command` to invoke commands for managing
its gems: updating, installing, and uninstalling. It seems that
`zed::Command` does not set the working directory (`cwd`), which causes
the invoked commands to run against the root directory. Below is the log
of running `rbenv` with debug mode enabled via the `RBENV_DEBUG`
environment variable:
```
+ '[' gem = ruby ']'
+ export RBENV_ROOT=/Users/rbenv/.rbenv
+ RBENV_ROOT=/Users/rbenv/.rbenv
+ exec /opt/homebrew/bin/rbenv exec gem install --norc --no-user-install --no-format-executable --no-document solargraph
+(/opt/homebrew/bin/rbenv:23): '[' -z /Users/rbenv/.rbenv ']'
+(/opt/homebrew/bin/rbenv:26): RBENV_ROOT=/Users/rbenv/.rbenv
+(/opt/homebrew/bin/rbenv:28): export RBENV_ROOT
+(/opt/homebrew/bin/rbenv:30): '[' -z '' ']'
+(/opt/homebrew/bin/rbenv:31): RBENV_DIR=/
+(/opt/homebrew/bin/rbenv:38): export RBENV_DIR
+(/opt/homebrew/bin/rbenv:40): '[' -n '' ']'
+(/opt/homebrew/bin/rbenv:40): export RBENV_ORIG_PATH=/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
+(/opt/homebrew/bin/rbenv:40): RBENV_ORIG_PATH=/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
+(/opt/homebrew/bin/rbenv:64): shopt -s nullglob
+(/opt/homebrew/bin/rbenv:67): rbenv_bin=/opt/homebrew/bin/rbenv
++(/opt/homebrew/bin/rbenv:68): canonicalize /opt/homebrew/bin/rbenv
++(/opt/homebrew/bin/rbenv:43): canonicalize(): local readlink resolved_path
+++(/opt/homebrew/bin/rbenv:44): canonicalize(): type -P greadlink
++(/opt/homebrew/bin/rbenv:44): canonicalize(): readlink=
+++(/opt/homebrew/bin/rbenv:44): canonicalize(): type -P readlink
++(/opt/homebrew/bin/rbenv:44): canonicalize(): readlink=/usr/bin/readlink
+++(/opt/homebrew/bin/rbenv:46): canonicalize(): /usr/bin/readlink -f /opt/homebrew/bin/rbenv
++(/opt/homebrew/bin/rbenv:46): canonicalize(): resolved_path=/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv
++(/opt/homebrew/bin/rbenv:47): canonicalize(): printf '%s\n' /opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv
++(/opt/homebrew/bin/rbenv:48): canonicalize(): return 0
+(/opt/homebrew/bin/rbenv:68): libexec_dir=/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv
+(/opt/homebrew/bin/rbenv:69): libexec_dir=/opt/homebrew/Cellar/rbenv/1.3.2/libexec
+(/opt/homebrew/bin/rbenv:78): export PATH=/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
+(/opt/homebrew/bin/rbenv:78): PATH=/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
+(/opt/homebrew/bin/rbenv:80): RBENV_HOOK_PATH=:/Users/rbenv/.rbenv/rbenv.d
+(/opt/homebrew/bin/rbenv:81): '[' '!' /opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d -ef /Users/rbenv/.rbenv/rbenv.d ']'
+(/opt/homebrew/bin/rbenv:83): RBENV_HOOK_PATH=:/Users/rbenv/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d
+(/opt/homebrew/bin/rbenv:85): RBENV_HOOK_PATH=:/Users/rbenv/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d:/usr/etc/rbenv.d:/opt/homebrew/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+(/opt/homebrew/bin/rbenv:89): RBENV_HOOK_PATH=/Users/rbenv/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d:/usr/etc/rbenv.d:/opt/homebrew/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+(/opt/homebrew/bin/rbenv:90): export RBENV_HOOK_PATH
+(/opt/homebrew/bin/rbenv:92): shopt -u nullglob
+(/opt/homebrew/bin/rbenv:95): command=exec
+(/opt/homebrew/bin/rbenv:96): case "$command" in
++(/opt/homebrew/bin/rbenv:109): type -P rbenv-exec
+(/opt/homebrew/bin/rbenv:109): command_path=/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec
+(/opt/homebrew/bin/rbenv:110): '[' -z /opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec ']'
+(/opt/homebrew/bin/rbenv:118): shift 1
+(/opt/homebrew/bin/rbenv:119): '[' gem = --help ']'
+(/opt/homebrew/bin/rbenv:126): exec /opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec gem install --norc --no-user-install --no-format-executable --no-document solargraph
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:20): '[' gem = --complete ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:24): rbenv-version-name
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:6): '[' -z '' ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:7): rbenv-version-file
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:13): target_dir=
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:28): '[' -n '' ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:31): find_local_version_file /
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:16): find_local_version_file(): local root=/
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:17): find_local_version_file(): [[ / =~ ^//[^/]*$ ]]
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:18): find_local_version_file(): '[' -s //.ruby-version ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:22): find_local_version_file(): '[' -n / ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:23): find_local_version_file(): root=
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:17): find_local_version_file(): [[ '' =~ ^//[^/]*$ ]]
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:18): find_local_version_file(): '[' -s /.ruby-version ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:22): find_local_version_file(): '[' -n '' ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:22): find_local_version_file(): break
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:25): find_local_version_file(): return 1
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:32): '[' / '!=' / ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file:33): echo /Users/rbenv/.rbenv/version
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:7): RBENV_VERSION_FILE=/Users/rbenv/.rbenv/version
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:8): rbenv-version-file-read /Users/rbenv/.rbenv/version
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file-read:6): VERSION_FILE=/Users/rbenv/.rbenv/version
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file-read:8): '[' -s /Users/rbenv/.rbenv/version ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-file-read:21): exit 1
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:8): true
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:8): RBENV_VERSION=
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:11): IFS='
'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:11): read -d '' -r -a scripts
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:11): rbenv-hooks version-name
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:9): '[' version-name = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:18): RBENV_COMMAND=version-name
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:19): '[' -z version-name ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): IFS=:
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): read -r -a hook_paths
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:26): shopt -s nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:32): shopt -u nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:11): true
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:17): '[' -z '' ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:18): echo system
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-version-name:19): exit
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:24): RBENV_VERSION=system
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:25): RBENV_COMMAND=gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:27): '[' -z gem ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:32): export RBENV_VERSION
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:33): rbenv-which gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:14): '[' gem = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:30): RBENV_COMMAND=gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:32): '[' -z gem ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:37): RBENV_VERSION=system
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:39): '[' system = system ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:40): remove_from_path /Users/rbenv/.rbenv/shims
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:19): remove_from_path(): local path_to_remove=/Users/rbenv/.rbenv/shims
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:20): remove_from_path(): local path_before
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:21): remove_from_path(): local result=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:22): remove_from_path(): '[' '' '!=' :/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin: ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:23): remove_from_path(): path_before=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:24): remove_from_path(): result=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:22): remove_from_path(): '[' :/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/Users/rbenv/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin: '!=' :/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin: ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:23): remove_from_path(): path_before=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:24): remove_from_path(): result=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:22): remove_from_path(): '[' :/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin: '!=' :/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin: ']'
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:26): remove_from_path(): result=:/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:27): remove_from_path(): echo /opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:40): PATH=/opt/homebrew/Cellar/rbenv/1.3.2/libexec:/opt/homebrew/opt/rustup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:40): command -v gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:40): RBENV_COMMAND_PATH=/usr/bin/gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:46): [[ ! -x /usr/bin/gem ]]
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:50): IFS='
'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:50): read -d '' -r -a scripts
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:50): rbenv-hooks which
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:9): '[' which = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:18): RBENV_COMMAND=which
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:19): '[' -z which ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): IFS=:
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): read -r -a hook_paths
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:26): shopt -s nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:32): shopt -u nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:50): true
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:56): '[' -x /usr/bin/gem ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-which:57): echo /usr/bin/gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:33): RBENV_COMMAND_PATH=/usr/bin/gem
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:34): RBENV_BIN_PATH=/usr/bin
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:36): IFS='
'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:36): read -d '' -r -a scripts
++(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:36): rbenv-hooks exec
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:9): '[' exec = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:18): RBENV_COMMAND=exec
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:19): '[' -z exec ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): IFS=:
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:24): read -r -a hook_paths
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:26): shopt -s nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:28): for script in '"$path/$RBENV_COMMAND"/*.bash'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:29): echo /opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash.bash
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:27): for path in '"${hook_paths[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-hooks:32): shopt -u nullglob
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:36): true
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:37): for script in '"${scripts[@]}"'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:39): source /opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash.bash
++(/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash.bash:1): export RUBYLIB=/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash:
++(/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash.bash:1): RUBYLIB=/opt/homebrew/Cellar/rbenv/1.3.2/rbenv.d/exec/gem-rehash:
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:42): shift 1
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:43): '[' system '!=' system ']'
+(/opt/homebrew/Cellar/rbenv/1.3.2/libexec/rbenv-exec:46): exec -a gem /usr/bin/gem install --norc --no-user-install --no-format-executable --no-document solargraph
```
In the beginning, there is this line `+(/opt/homebrew/bin/rbenv:31):
RBENV_DIR=/` which indicates that the working directory is not set to
the worktree and `rbenv` uses the root directory.
The possible solutions are:
- Set the system Ruby via `rbenv`
- Set `RBENV_DIR` in the Ruby extension before invoking any `gem`
command. It's a hack, but it works.
- Check the `zed::Command` implementation to to see if the working
directory can be changed to the worktree root.
Closes #158
Closes #152
1 parent 8a61094 commit 63eb48f
3 files changed
+132
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
41 | 62 | | |
42 | 63 | | |
43 | 64 | | |
| |||
108 | 129 | | |
109 | 130 | | |
110 | 131 | | |
111 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
112 | 142 | | |
113 | 143 | | |
114 | 144 | | |
| |||
209 | 239 | | |
210 | 240 | | |
211 | 241 | | |
| 242 | + | |
212 | 243 | | |
213 | 244 | | |
214 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
215 | 250 | | |
216 | 251 | | |
217 | 252 | | |
218 | 253 | | |
219 | 254 | | |
220 | 255 | | |
| 256 | + | |
221 | 257 | | |
222 | 258 | | |
223 | 259 | | |
| |||
228 | 264 | | |
229 | 265 | | |
230 | 266 | | |
| 267 | + | |
231 | 268 | | |
232 | 269 | | |
233 | 270 | | |
234 | | - | |
| 271 | + | |
235 | 272 | | |
236 | 273 | | |
237 | 274 | | |
| |||
240 | 277 | | |
241 | 278 | | |
242 | 279 | | |
| 280 | + | |
243 | 281 | | |
244 | 282 | | |
245 | 283 | | |
246 | | - | |
| 284 | + | |
247 | 285 | | |
248 | 286 | | |
249 | 287 | | |
250 | 288 | | |
| 289 | + | |
251 | 290 | | |
252 | 291 | | |
253 | 292 | | |
254 | 293 | | |
255 | 294 | | |
256 | 295 | | |
| 296 | + | |
257 | 297 | | |
258 | 298 | | |
259 | 299 | | |
260 | | - | |
| 300 | + | |
261 | 301 | | |
262 | 302 | | |
263 | 303 | | |
264 | 304 | | |
| 305 | + | |
265 | 306 | | |
266 | 307 | | |
267 | 308 | | |
| |||
278 | 319 | | |
279 | 320 | | |
280 | 321 | | |
281 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
282 | 327 | | |
283 | 328 | | |
284 | 329 | | |
| |||
303 | 348 | | |
304 | 349 | | |
305 | 350 | | |
306 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
307 | 356 | | |
308 | 357 | | |
309 | 358 | | |
| |||
325 | 374 | | |
326 | 375 | | |
327 | 376 | | |
328 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
329 | 382 | | |
330 | 383 | | |
331 | 384 | | |
| |||
343 | 396 | | |
344 | 397 | | |
345 | 398 | | |
346 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
347 | 404 | | |
348 | 405 | | |
349 | 406 | | |
| |||
371 | 428 | | |
372 | 429 | | |
373 | 430 | | |
374 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
375 | 436 | | |
376 | 437 | | |
377 | 438 | | |
| |||
396 | 457 | | |
397 | 458 | | |
398 | 459 | | |
399 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
400 | 465 | | |
401 | 466 | | |
402 | 467 | | |
| |||
417 | 482 | | |
418 | 483 | | |
419 | 484 | | |
420 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
421 | 490 | | |
422 | 491 | | |
423 | 492 | | |
| |||
436 | 505 | | |
437 | 506 | | |
438 | 507 | | |
439 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
440 | 513 | | |
441 | 514 | | |
442 | 515 | | |
| |||
463 | 536 | | |
464 | 537 | | |
465 | 538 | | |
466 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
467 | 544 | | |
468 | 545 | | |
469 | 546 | | |
| |||
484 | 561 | | |
485 | 562 | | |
486 | 563 | | |
487 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
488 | 569 | | |
489 | 570 | | |
490 | 571 | | |
| |||
503 | 584 | | |
504 | 585 | | |
505 | 586 | | |
506 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
507 | 592 | | |
508 | 593 | | |
509 | 594 | | |
| |||
527 | 612 | | |
528 | 613 | | |
529 | 614 | | |
530 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
531 | 620 | | |
532 | 621 | | |
533 | 622 | | |
| |||
549 | 638 | | |
550 | 639 | | |
551 | 640 | | |
552 | | - | |
| 641 | + | |
553 | 642 | | |
554 | 643 | | |
555 | 644 | | |
| |||
575 | 664 | | |
576 | 665 | | |
577 | 666 | | |
578 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
579 | 672 | | |
580 | 673 | | |
581 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| |||
0 commit comments