InsideDarkWeb.com

Installing cocoapods on macOS Mojave

I have looked through a lot of these questions and none seem to apply. I am trying to install cocoapods and run pod init in my xcode project. When I run sudo gem install cocoa podsI get right the end and see this:

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 -I /Library/Ruby/Site/2.3.0 -r ./siteconf20200314-453-8td9mi.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.

And of course when I run pod init inside my Xcode project I get:

-bash: pod: command not found

Ask Different Asked by The Retro Gamer on November 11, 2021

2 Answers

2 Answers

I solved the issue with this

https://medium.com/@pfxstudio21/cocoapods-error-error-installing-cocoapods-396ef7a1393d

It will work for you, it did the trick for me

Answered by Ashiokai on November 11, 2021

It looks like CocoaPods 1.9.0, the latest version as of this writing, depends on a newer version of Ruby than 2.3.7. But macOS Mojave only includes Ruby 2.3.7, so you have a few different options.

  • Upgrade to macOS Catalina and get Ruby 2.6.3
  • Use Ruby Version Manager to install a newer version of Ruby
  • Install an older version of CocoaPods
    sudo gem install cocoapods -v 1.8.4

Sources

Other people have trouble with CocoaPods 1.9.0 on Mojave. 1 2 3 4 5

Some people got it working by upgrading to Ruby 2.6 or newer. 1 2

Answered by Nic on November 11, 2021

Add your own answers!

Related Questions

View play counts on iPad or iPhone?

4  Asked on August 8, 2020 by bassplayer7

   

How do I enable AVB on Mac catalina 10.15

1  Asked on August 8, 2020 by user3810484

     

Catalina > Mojave on old MacBook Pro

0  Asked on August 5, 2020 by ron

     

Update Container on macOS

0  Asked on August 1, 2020 by lupurus

   

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.