Ruby version does not switch

Ruby reference

$ rbenv local 2.4.9
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

Since it has not switched, check where you are referring.

$ which ruby

/.rbenv/shims/ruby We will make changes to refer to here.

Change reference destination

First, move to ~.

$ cd
~$ vi ~/.bash_profile

Use i to insert. (Make changes to the file ready.) Make the following changes.


export PATH="~/.rbenv/shims:/usr/local/bin:$PATH"
eval "$(rbenv init -)"

Exit Insert with esc. Save with Shift + ZZ and exit.

~$ source ~/.bash_profile

Apply the changes to your PC.

$ rbenv local 2.4.9
$ ruby -v
ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin20]

I was able to change the version. that's all.

Recommended Posts

Ruby version does not switch
Final confirmation when ruby version does not switch
Correspondence when Ruby version does not switch in rbenv
UriComponentsBuilder does not encode "+" depending on spring version
Terminal does not start
Sidekiq-limit_fetch does not work
[Ruby] How to use rbenv (version `x.x.x'is not installed)
Ruby classes are constants, not
Ruby # {} is not variable expansion
bundle install does not install mysql2
What to do if you installed Ruby with rbenv but the version does not change
Switch the version of bundler
Docker test DB does not start
Ruby environment construction summary ~ mac version ~
Project ruby and rails version upgrade
"Selection does not include main type"
eclipse package does not exist
openssl version information in ruby OPENSSL_VERSION
Container does not start with docker-compose