I was misled by this answer too. It 'works' in that no errors are generated when you run it from the console. However, it does not update Ruby. It updates Ruby Gems. Follow one of the other answers to update Ruby (using OS X Sierra). – informaton Aug 14 '17 at 19:40.
Are you not sure which Ruby version you are using right now? Wondering how to check it? Say no more. Here are two simple ways to check for it.
This will not update the system Ruby version. Instead it will install another version of ruby and this line tells bash to look for the new version instead. RubyGems, the Ruby package manager, should be installed on your machine if you previously have installed Ruby. Verify this by running: which gem Update RubyGems. To update to its latest version with: gem update -system Install gems. To install a gem (Ruby package), run: gem install.
irb and type:
From command line
Update Ruby Gem Mac
Are you using RVM?
rvm current and get the answer
Are you using rbenv? Just run
Do you want to know where your
ruby binary is installed? It can also sometimes reveal the version you are using as it is usually part of directory structure. Just run
Using gem env
Update Ruby For Mac Catalina
If you want to know even more about your current ruby setup, there is a command for that as well!