Cocoapods kurulumunda oluşan "Failed to build gem native extension." hatası nasıl çözülür?

FLUTTER MACOS COCOAPODS
Cocoapods kurulumunda oluşan "Failed to build gem native extension." hatası nasıl çözülür?

While installing Cocoapods, you may have encountered a problem like the following.

ERROR:  Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20201118-804-17lxjdu.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

If you have encountered a problem that progresses like this, the solution to the problem is quite simple. If you follow the steps below, you will have resolved this problem.

1. curl -L https://get.rvm.io | bash -s stable
2. rvm install ruby-2.6
3. rvm use ruby-2.6.3
4. rvm --default use 2.6.3
5. sudo gem install cocoapods