I usually build my jekyll
website using bundle install
. However I started getting following build error:
public_suffix-6.0.1 requires ruby version >= 3.0, which is incompatible with the current version, ruby 2.7.0
rbenv
is a lightweight Ruby version manager that lets you switch between multiple Ruby versions seamlessly.
Run:
ruby --version
You'll likely see:
ruby 2.7.0
rbenv install 3.1.2
rbenv global 3.1.2
rbenv versions
The output should list 3.1.2
as the active version.
If ruby --version
still shows 2.7.0
, ensure your shell is properly configured to use rbenv
.
~/.bashrc
, ~/.zshrc
, or ~/.bash_profile
):export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
source ~/.bashrc # Or source ~/.zshrc
rbenv
to update the shims:rbenv rehash
Check again:
ruby --version
Now, it should display:
ruby 3.1.2