简体   繁体   中英

How to uninstall/delete older ruby version and keep newer. I have two version of ruby installed

I had ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux] I had to upgrade it to ruby 2.3.1 through RVM because i wanted to upgrade rails. After upgrading ruby to (2.3.1) and then rails to (4.2.6) when i close terminal and re-open, it again use ruby 2.2.3p173 which is older version. and every time I have to run below command s to make it work on ruby 2.3.1

$ source ~/.rvm/scripts/rvm

$ type rvm | head -n 1

$ rvm --default use 2.3.1

看一下这个

Is there any way I do not have to run this process every time and by default I can use new version of ruby 2.3.1 ?

Your question is a little misleading. You have a system installation of ruby and installed rvm and another ruby version with that - and now you want to have sourced rvm per default.

To not need to do source ~/.rvm/scripts/rvm anymore, you just put that into your ~/.bash_profile (where it maybe already was put automatically) and ensure your terminal is a login shell.

For Gnome Terminal you click "Profile Preferences", and choose "Run command as login shell" in Tab "Title and Command".

If I did not figure correct shell configuration, follow instructions here: https://rvm.io/rvm/basics

Sorry information there are to many and system specific, to copy all here.

Firstly sudo apt-get purge ruby
And if you want to use a select version of ruby then try rvm use ruby 'version' .It will select the version you want to use for ruby

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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