Skip to content

Sorry to jump back in on this one, but I have been getting it pretty persistently since late last year. #39626

Description

@Bottx89

Sorry to jump back in on this one, but I have been getting it pretty persistently since late last year.

My debug output looks almost identical to @SoCuul:

% RBENV_DEBUG=1 rbenv init - zsh
+(/opt/homebrew/bin/rbenv:23): '[' -z '' ']'
+(/opt/homebrew/bin/rbenv:24): RBENV_ROOT=/Users/adavis/.rbenv
+(/opt/homebrew/bin/rbenv:28): export RBENV_ROOT
+(/opt/homebrew/bin/rbenv:30): '[' -z '' ']'
+(/opt/homebrew/bin/rbenv:31): RBENV_DIR=/Users/adavis
+(/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/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/bin
+(/opt/homebrew/bin/rbenv:40): RBENV_ORIG_PATH=/opt/homebrew/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/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.0/libexec/rbenv
++(/opt/homebrew/bin/rbenv:47): canonicalize(): printf '%s\n' /opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv
++(/opt/homebrew/bin/rbenv:48): canonicalize(): return 0
+(/opt/homebrew/bin/rbenv:68): libexec_dir=/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv
+(/opt/homebrew/bin/rbenv:69): libexec_dir=/opt/homebrew/Cellar/rbenv/1.3.0/libexec
+(/opt/homebrew/bin/rbenv:78): export PATH=/opt/homebrew/Cellar/rbenv/1.3.0/libexec:/opt/homebrew/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/bin
+(/opt/homebrew/bin/rbenv:78): PATH=/opt/homebrew/Cellar/rbenv/1.3.0/libexec:/opt/homebrew/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/bin
+(/opt/homebrew/bin/rbenv:80): RBENV_HOOK_PATH=:/Users/adavis/.rbenv/rbenv.d
+(/opt/homebrew/bin/rbenv:81): '[' '!' /opt/homebrew/Cellar/rbenv/1.3.0/rbenv.d -ef /Users/adavis/.rbenv/rbenv.d ']'
+(/opt/homebrew/bin/rbenv:83): RBENV_HOOK_PATH=:/Users/adavis/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.0/rbenv.d
+(/opt/homebrew/bin/rbenv:85): RBENV_HOOK_PATH=:/Users/adavis/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.0/rbenv.d:/opt/homebrew/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+(/opt/homebrew/bin/rbenv:89): RBENV_HOOK_PATH=/Users/adavis/.rbenv/rbenv.d:/opt/homebrew/Cellar/rbenv/1.3.0/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=init
+(/opt/homebrew/bin/rbenv:96): case "$command" in
++(/opt/homebrew/bin/rbenv:109): type -P rbenv-init
+(/opt/homebrew/bin/rbenv:109): command_path=/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init
+(/opt/homebrew/bin/rbenv:110): '[' -z /opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init ']'
+(/opt/homebrew/bin/rbenv:118): shift 1
+(/opt/homebrew/bin/rbenv:119): '[' - = --help ']'
+(/opt/homebrew/bin/rbenv:126): exec /opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init - zsh
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:22): '[' - = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:32): print=
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:33): no_rehash=
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:34): shells=()
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:35): '[' 2 -gt 0 ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:36): case "$1" in
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:38): print=1
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:47): shift
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:35): '[' 1 -gt 0 ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:36): case "$1" in
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:44): shells+=("$1")
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:47): shift
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:35): '[' 0 -gt 0 ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:50): '[' 1 -eq 0 ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:59): root=/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:60): root=/opt/homebrew/Cellar/rbenv/1.3.0/libexec
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:61): root=/opt/homebrew/Cellar/rbenv/1.3.0
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:63): rbenv_in_path=true
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:64): '[' -n /opt/homebrew/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/bin ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:65): PATH=/opt/homebrew/sbin:/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:/Users/adavis/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/adavis/bin:/Applications/RubyMine.app/Contents/MacOS:/Users/adavis/.local/bin
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:65): type -P rbenv
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:68): '[' -z 1 ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:147): mkdir -p /Users/adavis/.rbenv/shims /Users/adavis/.rbenv/versions
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:149): shell=zsh
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:150): case "$shell" in
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:158): '[' -n true ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:160): printf 'export PATH="%s/shims:${PATH}"\n' /Users/adavis/.rbenv
export PATH="/Users/adavis/.rbenv/shims:${PATH}"
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:161): printf 'export RBENV_SHELL=%s\n' zsh
export RBENV_SHELL=zsh
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:163): completion=/opt/homebrew/Cellar/rbenv/1.3.0/completions/rbenv.zsh
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:164): '[' -r /opt/homebrew/Cellar/rbenv/1.3.0/completions/rbenv.zsh ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:170): '[' -z '' ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:171): echo 'command rbenv rehash 2>/dev/null'
command rbenv rehash 2>/dev/null
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:174): IFS='
'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:174): read -d '' -r -a commands
++(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-init:174): rbenv-commands --sh
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:15): '[' --sh = --complete ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:21): '[' --sh = --sh ']'
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:22): sh=1
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:23): shift
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:29): IFS=:
+(/opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv-commands:29): read -d '' -r -a paths

HANGS HERE

The above command to list out the number of paths hangs for me as well.

Back to your first set of questions in this issue:

  1. Yes, near as I can tell, this is happening every time
  2. The bare, non-eval command hangs as does the non-eval with the --no-rehash option
  3. I moved .zshrc and .zprofile to .bak and the following completes without hanging:
adavis@AndyDavisMacBookPro-3 ~ % /opt/homebrew/Cellar/rbenv/1.3.0/libexec/rbenv
init - zsh
export PATH="/opt/homebrew/Cellar/rbenv/1.3.0/bin:${PATH}"
export PATH="/Users/adavis/.rbenv/shims:${PATH}"
export RBENV_SHELL=zsh
command rbenv rehash 2>/dev/null
rbenv() {
  local command
  command="${1:-}"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  rehash|shell)
    eval "$(rbenv "sh-$command" "$@")";;
  *)
    command rbenv "$command" "$@";;
  esac
}
adavis@AndyDavisMacBookPro-3 ~ %

I'll try digging in and see if there's something specific causing issues. I was running OMZ, but I thought I had that disabled and was still hanging.

Originally posted by @BiggerNoise in rbenv/rbenv#1593 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis issue/PR is invalidtriageDo not begin working on this issue until triaged by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions