0

I installed Ruby v2.6.3 via RVM on my laptop for a Rails application.

To activate it I ran:

rvm --default use 2.6.3

However, if I restart my macOS laptop and check the current version of Ruby using rvm list, then the old v2.3.3 version is set.

How do I permanently set the version "2.6.3" as the one to use? The same thing occurs on Ubuntu, when I deploy a Rails application, the Ruby version automatically reverts back to v2.3.3 instead of v2.6.3.


rvm list
   ruby-2.2.3 [ x86_64 ]
=* ruby-2.3.3 [ x86_64 ]
   ruby-2.4.2 [ x86_64 ]
   ruby-2.5.0 [ x86_64 ]
   ruby-2.6.1 [ x86_64 ]
   ruby-2.6.3 [ x86_64 ]

I noticed that after restarting my laptop, rvm list looks a bit different:

   ruby-2.2.3 [ x86_64 ]
=> ruby-2.3.3 [ x86_64 ]
   ruby-2.4.2 [ x86_64 ]
   ruby-2.5.0 [ x86_64 ]
   ruby-2.6.1 [ x86_64 ]
 * ruby-2.6.3 [ x86_64 ]

Now, version 2.6.3 is automatically set as the default, however the current version 2.3.3 is still selected.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
user984621
  • 46,344
  • 73
  • 224
  • 412
  • What does `rvm list` show? – Roman Alekseiev Mar 22 '20 at 15:09
  • @RomanAlekseiev added. – user984621 Mar 22 '20 at 15:10
  • so it shows that default and current version of ruby is 2.3.3. I suppose something wrong with PATH. Have you read this topic? https://stackoverflow.com/questions/5604877/how-to-use-rvm-default-on-macosx – Roman Alekseiev Mar 22 '20 at 15:15
  • Based on the update you posted, I would assume that you have changed into a directory that has a `.ruby-version` file that is changing your current version of Ruby. – anothermh Mar 22 '20 at 16:41
  • I've added this line: `source $HOME/.rvm/scripts/rvm` to the `~/.zshrc` file. However, still investigating what happened and why is not automatically used `2.6.3` and only `2.3.3` (the Rails app doesn't work on 2.3.3.) – user984621 Mar 22 '20 at 16:45
  • Do the following in order and post the output of each command: close all open shells/terminals; open a new terminal; `rvm list`; `ruby -v`; `ls .ruby-version`; `rvm --default use 2.6.3`; `rvm list`; `ruby -v`; then repeat all previous steps. – anothermh Mar 22 '20 at 19:32
  • Please do _not_ use "edit" or "update" tags to mark changes. Instead, simply incorporate the change as if it'd been there all along, writing for readability and to make sense. We can tell what changed and when if necessary. – the Tin Man Mar 22 '20 at 23:19
  • Please run `rvm info`, copy the output then paste it into your question, formatting it appropriately for readability. – the Tin Man Mar 22 '20 at 23:31

0 Answers0