DEV Community

Ameed Jamous
Ameed Jamous

Posted on

3

ERROR: Failed to build gem native extension.

Are you unable to install cocoapods on maxOS Catalina ? here is what might work for you.

On macOS Catalina I faced several issues install cocoapods, and below is the solution.

sudo gem install -n /usr/local/bin 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.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200416-2584-hct4l8.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
ameedjamous@Ameeds-iMac O2IOS-master % sudo gem install -n /usr/local/bin ruby-dev
ERROR:  Could not find a valid gem 'ruby-dev' (>= 0) in any repository
ERROR:  Possible alternatives: ruby_dev
ameedjamous@Ameeds-iMac O2IOS-master % sudo gem install -n /usr/local/bin ruby-devel
ERROR:  Could not find a valid gem 'ruby-devel' (>= 0) in any repository
ERROR:  Possible alternatives: ruby_dev, rubdev, ruby-DTL, ruby-avl, ruby-d2l
Enter fullscreen mode Exit fullscreen mode

Solution getting cocopods workings on macOS Catalina


# brew cleanup -d -v    
# brew install cocoapods

Enter fullscreen mode Exit fullscreen mode

Thought others might find this useful.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (4)

Collapse
 
shabdar profile image
Ali Shabdar

Short and sweet! Thanks.

Collapse
 
ameedjamous profile image
Ameed Jamous

Glad you find it useful! cheers.

Collapse
 
pypypypywong profile image
pypypypywong

Had the exact same issue. Thanks!!!!

Collapse
 
shubhamagarwal745 profile image
shubhamagarwal745

Thanks a lot, i faced the exact issue

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay