问题
After upgrading to macOS 10.15 I have some serious problems with the console. I got strong problems with rbenv and ruby.
Any new window or tab from the console gives me the following information:
user@macbook-name ~ % rbenv -v
rbenv 1.0.0-33-gc7dcaf1
user@macbook-name ~ % which ruby
/usr/bin/ruby
I tried reinstalling rbenv. I reinstalled ruby through rbenv. I wrote this line in ~/.zshrc
file:
export PATH="$HOME/.rbenv/bin:$PATH"
But as soon as I close the tab or exit the console window or the entire console, everything was reset. That is, I open, for example, a new tab and in it again:
user@macbook-name ~ % which ruby
/usr/bin/ruby
Tell me, please, how can I fix this? It’s impossible to work like that.
回答1:
The following commands helped me:
% echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
% echo 'eval "$(rbenv init -)"' >> ~/.zshenv
% echo 'source $HOME/.zshenv' >> ~/.zshrc
% exec $SHELL
来源:https://stackoverflow.com/questions/58363698/problems-with-zsh-on-macos-after-update