简体   繁体   English

安装了rvm的Ruby 2.4.0后,Mac OS上的Ruby 2.0.0消失了

[英]Ruby 2.0.0 on Mac OS disappeared after Installing Ruby 2.4.0 by rvm

I'm using mac, and Ruby 2.0.0 had been built in within Mac OS. 我使用的是Mac,而Ruby 2.0.0已在Mac OS中内置。

I used rvm to install new version of Ruby, because I had heart that rvm could keep different versions of Ruby in computers and could well manage them. 我使用rvm安装了新版本的Ruby,因为我坚信rvm可以在计算机中保留不同版本的Ruby并可以很好地管理它们。

I used the command to install Ruby 2.4.0: 我使用以下命令来安装Ruby 2.4.0:

$ rvm install 2.4.0 --disable-binary

Then check the Ruby versions kept by rvm : 然后检查rvm保存的Ruby版本:

$ rvm list

rvm rubies

=* ruby-2.4.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

There was only one version listed. 仅列出了一个版本。 Only Ruby 2.4.0. 仅Ruby 2.4.0。

The Ruby 2.0.0 was not displayed. Ruby 2.0.0未显示。 Why? 为什么?


The Ruby 2.4.0 can be found by which ruby : ~/.rvm/rubies/ruby-2.4.0/bin/ruby Ruby 2.4.0可以通过以下which ruby来找到: ~/.rvm/rubies/ruby-2.4.0/bin/ruby

But I can find that the /library/Ruby contain the Ruby 2.0.0, it exists in my computer. 但是我发现/ library / Ruby包含Ruby 2.0.0,它存在于我的计算机中。

Why Ruby 2.0.0 is not displayed by rvm? 为什么rvm不显示Ruby 2.0.0?

rvm list shows you the list of rubies you've installed through rvm, but doesn't say anything about your system ruby. rvm list显示了通过rvm安装的红宝石列表,但没有说明系统红宝石。 If you want to use your system ruby, try rvm use system , and then which ruby to confirm that you're using /usr/bin/ruby. 如果要使用系统红宝石,请尝试rvm use system ,然后尝试rvm use system which ruby来确认您正在使用/ usr / bin / ruby​​。

rvm list does not display the system Ruby version in the list. rvm list不在rvm list中显示系统Ruby版本。 That command only displays the Ruby versions that were installed through RVM. 该命令仅显示通过RVM安装的Ruby版本。 If you want to switch back to the system version of Ruby, run the command rvm use system . 如果要切换回Ruby的系统版本,请运行命令rvm use system After running that command, ruby -v should display that it is version 2.0.0. 运行该命令后, ruby -v应该显示它是2.0.0版本。

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

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