I am using macOS Mojave and when I try to install cocoapods using gem I am getting the following error.
Building native extensions. This could take a whi
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
to figure out your ruby configuration./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
then you should correct the configuration by doing next step.sudo xcode-select --switch /Library/Developer/CommandLineTools
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
again to see if the path has changed./Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
Now you can run gem install
to install cocoapods!