Final confirmation when ruby version does not switch

This goal

Correctly reflect the version of ruby installed by rbenv.

Assumed readership

--Installed with rbenv --Confirmed installed ruby --The pass is passing --rbenv init is described in ~ / .zshrc

The work up to this point is omitted because there are many good articles.

If you still can't switch versions, have you completed the following steps?

$rbenv versions
system
* 2.6.3 (set by /Users/.../.ruby-version)
2.6.4

Who is this .ruby-version?

Quote (when not switching with rbenv)

The version set by rbenv local is recorded in the .ruby-version file of the current directory, and as long as it is in that directory, it takes precedence over the version set by rbenv global.

From the above, the ruby version did not switch because the version recorded in ruby-version was prioritized. If you come this far, the goal is right there.

Finally switch the ruby version

$rm .ruby-version
$rbenv global(local)Installed ruby version
$rbenv rehash
$ruby -v(It is good if the version is switched here)

Thank you for your hard work.

reference

When not switching with rbenv Version does not switch in Ruby rbenv global 2.3.0

Recommended Posts

Final confirmation when ruby version does not switch
Do not return when memoizing in Ruby
[NetBeans] Story when it does not start
Does not recognize the library when implementing jcaptcha
Library not loaded when trying to upgrade the version of ruby and rails s