更新后macOS上Zsh的问题 [英] Problems with Zsh on macOS after update

查看:171
本文介绍了更新后macOS上Zsh的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到macOS 10.15后,控制台出现一些严重问题.我在使用rbenv和ruby时遇到了严重的问题.

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

我尝试重新安装rbenv.我通过rbenv重新安装了ruby.我在~/.zshrc文件中写了这一行:

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.

推荐答案

以下命令对我有帮助:

% echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
% echo 'eval "$(rbenv init -)"' >> ~/.zshenv
% echo 'source $HOME/.zshenv' >> ~/.zshrc
% exec $SHELL

这篇关于更新后macOS上Zsh的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆