Open your terminal and run
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable
For the rvm command to work, you need to run:
source ~/.rvm/scripts/rvm
Now, run rvm list known
This shows the list of versions of the Ruby interpreter.
Now, run rvm install ruby@latest to get the latest Ruby version.
If you type ruby -v in the terminal, you should see ruby X.X.X.
If it still shows you ruby 2.0., run rvm use ruby-X.X.X --default.
Prerequisites for Windows 10:
- C compiler. You can use http://www.mingw.org/
makecommand available otherwise it will complain that "bash: make: command not found". You can install it by runningmingw-get install msys-make- Add "C:\MinGW\msys\1.0\bin" and "C:\MinGW\bin" to your path environment variable
Open your terminal and run
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable
For the rvm command to work, you need to run:
source ~/.rvm/scripts/rvm
Now, run rvm list known
This shows the list of versions of the Ruby interpreter.
Now, run rvm install ruby@latest to get the latest Ruby version.
If you type ruby -v in the terminal, you should see ruby X.X.X.
If it still shows you ruby 2.0., run rvm use ruby-X.X.X --default.
Prerequisites for Windows 10:
- C compiler. You can use http://www.mingw.org/
makecommand available otherwise it will complain that "bash: make: command not found". You can install it by runningmingw-get install msys-make- Add "C:\MinGW\msys\1.0\bin" and "C:\MinGW\bin" to your path environment variable
Homebrew-only solution
A better solution
From the comments (kudos to Maksim Luzik), what seems like a more elegant solution:
After installing Ruby through brew, run the following command to update the links to the latest Ruby installation:
brew link --overwrite ruby --force
Reopen a terminal to reset zshrc.
Check the installlation with ruby --version and gem --version, then run gem install bundler.
Earlier solution
Using brew is enough. It's not necessary to install rvm and for me it just complicated things.
By brew install ruby you're actually installing the latest (currently v2.4.0). However, your path finds 2.0.0 first. To avoid this just change precedence (source). I did this by changing ~/.profile and setting:
export PATH=/usr/local/bin:$PATH
After this, I found that the bundler gem was still using version 2.0.0. Just install it again: gem install bundler
System ruby on mac
How can I update my Ruby version on macOS from 2.0.0 to the latest release? - Ask a Question - TestMu AI Community
How to install ruby on macOS - rubyonrails-talk - Ruby on Rails Discussions
How do I upgrade from 2.3.7 to 2.7.4 on macOS and Linux?
Videos
I was trying to update my flutter setup and I saw that I need to update my ruby.
I then saw that I shouldn't use the system ruby.
How can I know if I f'ed up and did something wrong? Is there a way to revert any changes I did to that?