(ruby)从rvm切换到rbenv

卸载rvm(如果已经安装了的话):

$ rvm implode

安装rbenv

$ brew install rbenv ruby-build

开一个新的terminal,测试命令:

添加rbenv的路径:

$ echo 'export PATH=~/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:$PATH' >> ~/.zshrc

查看可以安装的ruby版本:

$ rbenv install -l

安装所需版本:

使用rbenv global命令设置全局环境所使用的ruby版本:

$ rbenv global 2.7.1

查看设置后所使用的ruby:

补充

使用rbenv init来设置环境也可以:

My Github Page: https://github.com/liweinan

Powered by Jekyll and Theme by solid

If you have any question want to ask or find bugs regarding with my blog posts, please report it here:
https://github.com/liweinan/liweinan.github.io/issues