Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM not keeping ruby version

Tags:

ruby

rvm

I have to keep setting my ruby version. How to I make sure RVM keeps the version I need?

When I do rvm list, I get:

   ruby-2.1.0 [ x86_64 ]
   ruby-2.1.2 [ x86_64 ]
   ruby-2.4.4 [ x86_64 ]
   ruby-2.5.1 [ x86_64 ]
   ruby-2.5.2 [ x86_64 ]
   ruby-2.5.3 [ x86_64 ]
   ruby-2.6.1 [ x86_64 ]
=> ruby-2.6.3 [ x86_64 ]
 * ruby-2.6.5 [ x86_64 ]

So then I do rvm use 2.6.5 and it changes to 2.6.5, but as soon as I close and open the terminal again, I whichs back to 2.6.3. What am I doing wrong? I set the default 2.6.5, it just does not seem to listen.

like image 517
user2012677 Avatar asked Aug 05 '26 09:08

user2012677


2 Answers

In the rvm list we clearly see the default is set correctly (marked with the asterisk), so check your current folder for the presence of a .rvmrc or .ruby-version file which will overrule the rvm default version.

like image 162
nathanvda Avatar answered Aug 08 '26 01:08

nathanvda


EDIT: As OP stated, they were correctly setting the default but having it overriden by a .ruby-version file, see above and ignore below

You're telling RVM to use 2.6.5, not setting it as the default.

Try:

rvm --default use 2.6.5

See "The Basics of RVM" for more information.

like image 34
Mark Avatar answered Aug 08 '26 00:08

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!