3

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.

user2012677
  • 5,465
  • 6
  • 51
  • 113
  • 1
    This question is wrongly marked as a duplicate: the default is clearly set correctly, visible from the output from `rvm list`. You should check if there is a `.rvmrc` or `.ruby-version` file in the directory which will automatically set the ruby version regardless of the default. – nathanvda Nov 23 '19 at 19:46

2 Answers2

4

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.

nathanvda
  • 49,707
  • 13
  • 117
  • 139
3

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.

Mark
  • 6,112
  • 4
  • 21
  • 46