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
rbenv version
And when you look at the version,
2.7.2 (set by /Users/○○○(username)/.ruby-version)
I get it,
ruby -v
When you put it in
ruby 2.6.3p62
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
from
source ~/.zshrc
from
rbenv global 2.7.2
I tried to put it. When I check it,
ruby 2.7.2p137
The character is!
Dreadfully close and reopen the terminal
ruby -v
When I put it in
ruby 2.7.2p137
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.
Recommended Posts