user2012677
user2012677

Reputation: 5735

RVM not keeping ruby version

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.

Upvotes: 3

Views: 690

Answers (2)

Mark
Mark

Reputation: 6445

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.

Upvotes: 3

nathanvda
nathanvda

Reputation: 50057

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.

Upvotes: 4

Related Questions