简体   繁体   English

我的macOS上的多个ruby版本将自动切换版本

[英]multiple ruby version on my macOS will auto switch version

pre: in my mac, I install rvm and rbenv both set a separate version. 上一个:在我的Mac中,我安装rvm和rbenv都设置了单独的版本。

and I look up "brew info ruby" is another version. 我查找“ brew info ruby​​”是另一个版本。 in the terminal I use "ruby -v" is 2.3.7 is another version that I never set. 在终端中,我使用的“ ruby​​ -v”是2.3.7,这是我从未设置的另一个版本。

last time i use rvm to set default and current version to 2.5.3 it useful. 上次我使用rvm将默认和当前版本设置为2.5.3很有用。 then current that's wasn't work. 那么当前那是行不通的。 how I to correct this issue... 我如何纠正这个问题...

  • brew info ruby => 2.6.3 酿造信息红宝石=> 2.6.3
  • rvm default and current 2.5.3 RVM默认和当前2.5.3
  • rbenv global and local 2.5.3 rbenv全球和本地2.5.3
  • in terminal $ ruby -v 2.3.7 that's never set 在终端$ ruby​​ -v 2.3.7中从未设置

Choose only one of them. 仅选择其中之一。 You really can not have rbenv and rvm at same time. 您确实不能同时拥有rbenv和rvm。 With rvm, it overrides the 'gem' command, so that would make rbenv useless. 使用rvm时,它将覆盖'gem'命令,因此将使rbenv无效。

Try this with rbenv: 尝试使用rbenv:

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

Then: 然后:

rbenv global 2.5.3

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

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