To update your Ruby version on macOS to a compatible version for Jekyll 2.7.0 and higher, you can follow these steps:
- Install Homebrew (if not already installed) by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Update Homebrew:
brew update
- Install the latest version of Ruby:
brew install ruby
- Switch to the installed Ruby version:
brew switch ruby 2.7.2
Replace 2.7.2 with the latest version of Ruby you want to use.
- Install RVM (Ruby Version Manager) to manage multiple Ruby versions:
\curl -sSL https://get.rvm.io | bash -s stable
- Add RVM to your shell:
source ~/.rvm/scripts/rvm
- Install the Ruby version you have installed using Homebrew:
rvm install 2.7.2
- Set the newly installed Ruby version as the default:
rvm use 2.7.2 --default
- Verify the Ruby version:
ruby -v
Now, you should have Ruby 2.7.2 installed on your macOS system, and it is set as the default version. You can now install Jekyll using the following command:
gem install jekyll bundler
References: