Error when I install jekyll using gem

I got permission error when I run gem install jekyll

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/yifan/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/.rubocop.yml

I possibly used sudo before. Does anyone knows how to solve this issue?

Advanced thanks!

Here the same

gem install jekyll
OUTPUT
ERROR: While executing gem … (Errno::EACCES)
Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/.rubocop.yml

You can try uninstalling the gem and reinstalling the ship in normal user mode.