$ 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
/usr/bin/ruby
/.rbenv/shims/ruby
We will make changes to refer to here.
First, move to ~
.
$ cd
~$ vi ~/.bash_profile
Use i
to insert. (Make changes to the file ready.)
Make the following changes.
vim
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