You need to add two things to your PATH. First rbenv itself and second the ruby shims.

Part 1 rbenv

Installation

Homebrew

If you installed rbenv with brew, then the rbenv executable should be linked to /usr/local/bin/rbenv.

See homebrew installation documentation for details.

Please add /usr/local/bin to your path PATH, if it is missing.

# in ~/.zshrc

export PATH=/usr/local/bin:$PATH

Github Checkout

If you install rbenv via a Github checkout, then the rbenv executalbe should be stored in ~/.rbenv/bin.

See github installation documentation for details.

Please add ~/.rbenv/bin to your path PATH, if it is missing.

# in ~/.zshrc

export PATH=$HOME/.rbenv/bin:$PATH

Verfiy

Please verify that rbenv is in your path by calling which rbenv. The installation path should be returend.

Part 2 shims

Add the ruby shims to you path.

# in ~/.zshrc

eval "$(rbenv init -)"

Instead of the eval "$(rbenv init -)" command you can also add the shims folder directly.

# in ~/.zshrc

export RBENV_ROOT=$HOME/.rbenv
export PATH=$RBENV_ROOT/shims:/versions:$PATH

Part 3 rbenv doctor

You might also run the rbenv-doctor script mentioned here, to check your installation.

Answer from Thomas Koppensteiner on Stack Overflow
🌐
GitHub
github.com › Shopify › vscode-ruby-lsp › issues › 587
Failed to activate Ruby · Issue #587 · Shopify/vscode-ruby-lsp
April 26, 2023 - Failed to activate rbenv environment: Command failed: 'rbenv exec ruby --disable-gems -rjson -e "printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump(ENV.to_h))"' ''rbenv' is not recognized as an internal or external command, operable program or batch file.
Author   Shopify
🌐
GeekChamp
geekchamp.com › home › how to fix: is not recognized as an internal or external command, operable program or batch file error
How to Fix: Is Not Recognized as an Internal or External Command, Operable Program or Batch File Error - GeekChamp
1 month ago - If it returns an unexpected path, adjust PATH order, remove old entries, or disable conflicting app aliases. The “is not recognized as an internal or external command, operable program or batch file” error almost always means Windows cannot find the command you typed.
🌐
GitHub
github.com › rbenv › rbenv › issues › 976
[FIXED] bash: rbenv: command not found · Issue #976 · rbenv/rbenv
March 3, 2017 - Just wanted to post this as a solution and not an issue for what the title says. Just copy paste these commands as they are in a new Terminal. cd ~ rm -rf .rbenv/ git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH=...
Author   rbenv
🌐
GitHub
github.com › rbenv › rbenv › issues › 670
bash: rbenv: command not found · Issue #670 · rbenv/rbenv
December 21, 2014 - cd git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build '
Author   rbenv
Find elsewhere
🌐
Google Groups
groups.google.com › g › rubyinstaller › c › ArIAemWTkKY
'ruby' is not recognized as an internal or external command, etc.--but 'ruby.exe' IS
Try the following: 1) Run installer checking both boxes for modifying your path and associated .rb/.rbw files 2) After installation finishes, open up a new command prompt and type the following 2 commands: echo %PATH% echo %PATHEXT% 3) open up the env var dialog of your system properties and see what the values for PATH and PATHEXT are 4) If you're comfortable running "regedit" do so and see what the values are for PATH and PATHEXT depending upon whether you ran the installer from an administrator account or a standard user: Admin -> HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment Standard -> HKCU\Environment 5) Uninstall the fake installer 6) Open up a completely new command prompt and repeat steps (2) - (4) If this all correlates with the issue you've reported, I'll roll another FakeInstaller with (hopefully) a fix to your issue for further testing.
🌐
Team Treehouse
teamtreehouse.com › community › after-rbenv-installation-typing-rbenv-in-command-line-gives-error-bash-rbenv-command-not-found
After rbenv installation, typing rbenv in command line gives error: -bash: rbenv: command not found (Example) | Treehouse Community
August 2, 2014 - Konrad is right sounds like a $PATH variable issue. Basically $PATH holds a list of directories, when you issue a command, Bash will check $PATH list of directories for the program that can run it.
🌐
GitHub
github.com › rbenv › rbenv › issues › 474
-bash: rbenv: command not found · Issue #474 · rbenv/rbenv
October 29, 2013 - git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Author   rbenv