My Ruby stays 2.6.3 ...it doesn't change to the correct version


#1

I assume it HAS to be 2.6.4 or 2.6.5 as the instructions say. Plus, it does’t let me install rails so, I guess I have to pass this first.


[SOLVED] Problem installing lastest version of Ruby
#2

Do you have 2.6.5 installed @abrolon87? If not, into your terminal type:

rbenv install 2.6.5 --verbose

If 2.6.5 is already installed then, to make it your default version type:

rbenv global 2.6.5

Then, to make sure everything works, type ruby -v. You should see:

ruby 2.6.5pxx (20xx-xx-xx revision xxxxx)

If you don’t see the output above, log off and log back on, then try again :+1:


#3

main@Amandas-MacBook-Air ~ % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

I just keep getting this. I went back through the steps 2 times for installation and the first time, I realized the right version of Ruby wasn’t being used so, I have been stuck there.

I just tried what you mention here and this happened:
Installed ruby-2.6.5 to /Users/main/.rbenv/versions/2.6.5

main@Amandas-MacBook-Air ~ % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
main@Amandas-MacBook-Air ~ % rbenv global 2.6.5
main@Amandas-MacBook-Air ~ % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
main@Amandas-MacBook-Air ~ %

What am I doing wrong? :frowning:


#4

@abrolon87 Try:

rvm uninstall 2.6.3

Then repeat the steps above.


#5

main@Amandas-MacBook-Air ~ % rvm uninstall 2.6.3
zsh: command not found: rvm
main@Amandas-MacBook-Air ~ %


#6

@abrolon87 Are you running the latest Mac? If so then at the point in the installation instructions where you have to echo rbenv init to >> ~/.bash_profile you need to replace bash_profile with zshrc


#7

You mean Catalina? Yeah…


#8

I just tried it and it worked! Thank you so much! :smiley:


#9

I’m having the same problem as abrolon87. I’ve done everything in the instructions exactly, and I’ve even echo’d the rbenv into ~/.zshrc and it still will not change the version of ruby from 2.6.4 to 2.6.5. I’m on a MBP with Catalina OS.


#10

Update:

I found on stack exchange a suggestion of running $ rbenv local 2.6.5 and that successfully
caused my terminal to verify ruby 2.6.5p114 (2019-10-01 revision 67812)

So it appears to be updated to the correct version now.


#11

That doesn’t sound right that you should have to run rbenv local @eathom91

In your terminal when just in the normal home directory type the following commands and let me know the response:

ruby -v
which ruby
echo $PATH

#12

I also could only install ruby 2.6.3 instead of 2.6.5. I tried to replace bash_profile with zshrc as someone suggested above but it didn’t work.

Anhs-MacBook-Pro:~ anhdungle$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

Anhs-MacBook-Pro:~ anhdungle$ which ruby
/usr/bin/ruby

Anhs-MacBook-Pro:~ anhdungle$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin


#13

@anhdungle93rbenv is not installed in your path there.

What is the output of cat ~/.zshrc


#14

the output is

Anhs-MacBook-Pro:~ anhdungle$ cat ~/.zshrc
eval “$(rbenv init -)”
eval “$(rbenv init -)”


#15

Can you close all open terminals, and then open a new one and then let me know the output of echo $PATH


#16

the output is
Anhs-MacBook-Pro:~ anhdungle$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

Edit: I am a new user so I cannot post more than 3 posts in the same topic so I edit here
the next output is

Anhs-MacBook-Pro:~ anhdungle$ rbenv init

Load rbenv automatically by appending

the following to ~/.bash_profile:

eval “$(rbenv init -)”


#17

Type rbenv init and let me know the output.


#19

This might look a little better than what I previously posted (uploaded another image). This is my output, maybe it’s got something to do with the duplicate .rbenv paths in there?


#20

Restaring the terminal after ~ rbenv install 2.6.5 and rbenv global 2.6.5 worked for me.