Problems with Zsh on macOS after update

本小妞迷上赌 提交于 2019-12-11 11:02:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!