I just installed ruby 3.0.4 using rbenv install 3.0.4, which worked, but rbenv still says:
$ rbenv versions
rbenv: version `3.0' is not installed (set by /home/dombek/code/.ruby-version)
system
3.0.4
Shouldn't it find 3.0.4 when 3.0 is requested? How can I fix that?
Nope. This is expected behaviour. rbenv expects the exact version specified in the
.ruby-versionfile to be installed and set for use.Depends what you mean by fix. The obvious answer here is to just specify the correct version:
Alternatively, you can set 3.0.4 globally or locally using rbenv:
After changing the version, you should rehash rbenv to apply changes:
Finally, I'm not sure how practical this is, but you could theoretically write a bash script that lets you specify a ruby version like "3.0". Something like:
^ untested.