Cocoapods installation error in terminal

I’m trying to install cocoapods and these happens help me to resolve
currently I’m using macOs mojave 10.14.6
(base) nikhils-MacBook-Air:~ nikhilshekhawat$ sudo gem install cocoapods
Password:
Building native extensions. This could take a while…
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.

current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2/ext/ffi_c

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200324-6597-m7dqf7.rb extconf.rb
mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out

This other post may help

check your terminal is running on bash

How do I make my terminal on my MacBook run bash? The websites I have searched and threads I have read don’t seem to give helpful explanations.

You should not need to run the bash shell to install Cocoapods. The current version of the shell is zsh.

What Mac do you have and what processor is it running?

What errors (if any) are you getting while trying to install Cocoapods?