3

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

Check this out

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 ?

Shyam Bhimani
  • 1,310
  • 1
  • 22
  • 37
  • If your default isn't sticking there's something wrong with your `rvm` install. – tadman May 12 '16 at 22:00
  • what possibly could have went wrong ? and how would I fix it ?@tadman – Shyam Bhimani May 12 '16 at 22:02
  • Reinstalling it is a good first step, you can do that in-place without breaking anything. Second step is to see why `rvm versions` doesn't show the correct one being activated on login. `--default` should set that. – tadman May 12 '16 at 22:05
  • What is the value for GEM_PATH and GEM_HOME in your environment variables? – Elvn May 12 '16 at 22:27
  • Possible duplicate of [How can I uninstall Ruby on ubuntu?](http://stackoverflow.com/questions/3957730/how-can-i-uninstall-ruby-on-ubuntu) – Aniket Tiwari May 13 '16 at 05:08
  • It only provides information on how to delete ruby. In my case I need to use `ruby 2.3.1` as by default in stead of `ruby 2.2.3` thus it is not duplicate question. @AniketShivamTiwari – Shyam Bhimani May 13 '16 at 05:51
  • Until you get GEM_PATH and GEM_HOME set properly you will have to reset your default Ruby version -- Ruby is a gem. – Elvn May 13 '16 at 13:19
  • 1
    This does not appear to be a duplicate of the nominated exemplar, which asks how to uninstall the system Ruby. Uninstalling the system Ruby may or may not be the solution (or part of the solution) to this problem, but we don't know that. – Wayne Conrad May 13 '16 at 17:19

2 Answers2

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.

bpieck
  • 241
  • 1
  • 6
0

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

Aniket Tiwari
  • 3,561
  • 4
  • 21
  • 61