rbenv works but rbenv install is not a command
rbenv install does nothing or is not recognised as a commandShort answer
rbenv itself does not build Ruby. The install command comes from the ruby-build plugin, which lives in rbenv's plugins folder. If that plugin is missing, in the wrong folder or old, rbenv install is missing or does not know a new version. Clone ruby-build into the plugins directory, or update it.
Fix it fast
1Find out which cause you have
Ask rbenv where it lives and which plugins it can see.
rbenv root ls "$(rbenv root)/plugins"2Match what you see, then jump to its fix
- 1
The plugins folder is empty or does not existThe ruby-build plugin was never installedFix - 2
ruby-build exists on disk, but not under the path printed by rbenv rootThe plugin is in the wrong folderFix - 3
rbenv install works, but the version you ask for is not in the listThe plugin is too old to know the Ruby version you wantFix
- 1
What does the error look like?
rbenv install does nothing or is not recognised as a commandthe newest Ruby version is not in the rbenv install --list output
Cause 1 of 3
The ruby-build plugin was never installed
1Check
rbenv from a git checkout does not include ruby-build. The rbenv README says to install the plugin if the install command is missing.
ls "$(rbenv root)/plugins/ruby-build"2Fix
Clone ruby-build into rbenv's plugins directory. With Homebrew, use brew install ruby-build instead.
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build3Verify
The command should now be known and list versions.
rbenv install --listConfirmed by github.com
Cause 2 of 3
The plugin is in the wrong folder
1Check
rbenv only loads plugins from the plugins directory under its own root. A clone in your home folder or beside rbenv is not picked up. Compare the two paths.
rbenv root
find ~ -maxdepth 4 -type d -name ruby-build 2>/dev/null2Fix
Move the clone to the plugins directory of the root that rbenv reports.
mkdir -p "$(rbenv root)/plugins"
mv ~/ruby-build "$(rbenv root)/plugins/ruby-build"3Verify
Check the command again.
rbenv install --listConfirmed by github.com
Cause 3 of 3
The plugin is too old to know the Ruby version you want
1Check
ruby-build ships one definition file per Ruby version, so a new Ruby release is not offered until ruby-build itself is upgraded.
rbenv install --list | tail -n 52Fix
Update the plugin: git pull in its folder, or brew upgrade ruby-build with Homebrew.
git -C "$(rbenv root)"/plugins/ruby-build pull3Verify
List the versions again, then install the one you want.
rbenv install --list
rbenv install 3.4.1Confirmed by github.com
How do I stop it coming back?
- Install rbenv and ruby-build together, and note both in your machine setup script.
- Update ruby-build before you install a new Ruby version.
- Install build tools and development headers before running rbenv install; ruby-build does not check most of them. Its wiki lists the suggested build environment.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix