Could not find a valid gem 'jekyll' (>= 0)

On Ubuntu 22.04.4 LTS, I am following Jekyll on Ubuntu | Jekyll • Simple, blog-aware, static sites. But I am having this error:

$ gem install jekyll bundler
ERROR:  Could not find a valid gem 'jekyll' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Net::OpenTimeout: execution expired (https://rubygems.org/specs.4.8.gz)

Installed Ruby and Gem:

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
$ gem -v
3.3.5

Check the first 2 steps of this tutorial. This might help you set up a ruby environment.