I'm just starting programming recently, but I'd like to mention the problems I had when trying to update Ruby to a new one and how to solve it.
The environment is MacBook Pro OS Catalina. The original version of Ruby was 2.6.3. When I tried to update to 2.7.2.
You should have installed 2.7.2 from the Ruby update command from rbenv
And when you look at the version,
2.7.2 (set by /Users/○○○(username)/.ruby-version)
I get it,
When you put it in
The characters are ...
If you look at various sites
which ruby rbenv global 2.7.2
Even if you put it in, it doesn't change at all. Similarly, when I type in the article of the person who is in trouble, while the terminal is open, it is temporarily fixed, but when I close it and check the version again, it returns to 2.6.3.
This code was useful at that time.
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
rbenv global 2.7.2
I tried to put it. When I check it,
The character is!
Dreadfully close and reopen the terminal
When I put it in
The character came out! If you are having trouble with the same phenomenon, please give it a try.
reference: Progate: "Prepare a Ruby development environment!"
I solved it by referring to this code of Progate.