How to tell RVM (Ruby Version Manager) to remember my set default when I open a new terminal window

浪尽此生 提交于 2019-12-20 05:45:15

问题


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.

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

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

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

=> /usr/bin/ruby

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?


回答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

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

rvm install ruby
rvm --default use ruby


来源:https://stackoverflow.com/questions/52788641/how-to-tell-rvm-ruby-version-manager-to-remember-my-set-default-when-i-open-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!