简体   繁体   English

MacOs Catalina 未安装最新的 2.7.2 Ruby 版本

[英]Latest 2.7.2 Ruby version didn't installed at MacOs Catalina

Could somebody tell me how to install the latest version of Ruby?有人能告诉我如何安装最新版本的 Ruby 吗? I've done我弄完了

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
source ~/.zshrc

# Install Ruby
rbenv install 2.7.2
rbenv global 2.7.2
ruby -v

Besides while I'm running ruby -v :此外,当我运行ruby -v

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

Instead of 2.7.2.而不是 2.7.2。 What have I missed?我错过了什么?

Thanks谢谢

Try which ruby and see what comes up.尝试使用which ruby ,看看会发生什么。 If it's the system ruby and not the rbenv one, you need to add this to your profile:如果是系统 ruby​​ 而不是 rbenv ,则需要将其添加到您的配置文件中:

export PATH="$HOME/.rbenv/shims:$PATH"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM