Cocoapods failing to install on MacOS 10.14.6 and Xcode 11.3

Skip to first unread message

amit agarwal

Jun 21, 2021, 5:13:33 AM6/21/21
to CocoaPods
I am new to the group and trying to install cocoa pods on my MacBook.  Unfortunately it continues to fail when I use the standard gem command

sudo gem install cocoapods

I get an error that seems to indicate that it can't find the proper header files to compile.

I am posting a copy of the mkmf.log file contents at the end of this message.

Any help to get this installed would be greatly appreciated.This is a blocker for me.

amiagarw-mac:~ amiagarw$ sudo gem install cocoapods
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.15.3/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20210621-9390-111zuv2.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.15.3 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.15.3/gem_make.out

Martin Yu

Jun 21, 2021, 5:26:56 AM6/21/21
to CocoaPods
I think you can try to install an rvm, then install another version of ruby, such as 2.6.3, and finally install cocoapods
Reply all
Reply to author
0 new messages