当我打开一个新的终端窗口时,如何告诉 RVM(Ruby 版本管理器)记住我设置的默认值 [英] How to tell RVM (Ruby Version Manager) to remember my set default when I open a new terminal window

查看:54
本文介绍了当我打开一个新的终端窗口时,如何告诉 RVM(Ruby 版本管理器)记住我设置的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 RVM 安装 Ruby 2.5.1,并将其设置为默认值.但是,当我打开一个新的终端窗口并输入 which ruby​​ 时,我得到了我机器的 Ruby 的路径,而不是我设置的路径.

I used RVM to install Ruby 2.5.1, and set that to the default. However when I open a new terminal window, and type which ruby I get the path to my machine's Ruby not the one I set.

例如,当我设置默认值并运行which ruby​​时:

For example, when I set the default and run which ruby:

=> /home/COM-COM/.rvm/rubies/ruby-2.5.1/bin/ruby

当我打开一个新的终端窗口并运行 which ruby​​ 时:

When I open a new terminal window and run which ruby:

=> /usr/bin/ruby

我想当我运行 rvm --default use 2.5.1 RVM 会记住设置的默认值,直到我更改它.

I thought when I ran rvm --default use 2.5.1 RVM would remember the set default until I changed it.

有谁知道这里发生了什么,有没有人有解决方案?

Does anyone know what's going on here, and does anyone have a solution?

推荐答案

如果你想安装特定版本的 Ruby (2.5.1),你可以使用这个:

If you want to install a specific version of Ruby (2.5.1), you can use this:

rvm install ruby-2.5.1
rvm --default use ruby-2.5.1

如果您想安装和使用最新版本的 Ruby,您可以使用以下命令:

If you wanted to install and use the latest version of Ruby, you can use the following:

rvm install ruby
rvm --default use ruby

这篇关于当我打开一个新的终端窗口时,如何告诉 RVM(Ruby 版本管理器)记住我设置的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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