CocoaPods1.9.0 cannot install on Mojave10.14.6

Created on 27 Feb 2020  Â·  17Comments  Â·  Source: CocoaPods/CocoaPods

Installing CocoaPods1.9.0 on Mojave10.14.6 resulted in the following error:

$ sudo gem install cocoapods
Password:
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.6.gem (100%)
Successfully installed tzinfo-1.2.6
Fetching: concurrent-ruby-1.1.6.gem (100%)
Successfully installed concurrent-ruby-1.1.6
Fetching: i18n-0.9.5.gem (100%)
Successfully installed i18n-0.9.5
Fetching: activesupport-4.2.11.1.gem (100%)
Successfully installed activesupport-4.2.11.1
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: httpclient-2.8.3.gem (100%)
Successfully installed httpclient-2.8.3
Fetching: algoliasearch-1.27.1.gem (100%)
Successfully installed algoliasearch-1.27.1
Fetching: ffi-1.12.2.gem (100%)
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 -r ./siteconf20200228-1108-r7oagr.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.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out

Forcibly, Installing CocoaPods1.8.4 works fine.

$ sudo gem install -v1.8.4 cocoapods
Password:
Fetching: cocoapods-core-1.8.4.gem (100%)
Successfully installed cocoapods-core-1.8.4
Fetching: claide-1.0.3.gem (100%)
Successfully installed claide-1.0.3
Fetching: cocoapods-deintegrate-1.0.4.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.4
Fetching: cocoapods-downloader-1.3.0.gem (100%)
Successfully installed cocoapods-downloader-1.3.0
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-stats-1.1.0.gem (100%)
Successfully installed cocoapods-stats-1.1.0
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: cocoapods-trunk-1.4.1.gem (100%)
Successfully installed cocoapods-trunk-1.4.1
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: molinillo-0.6.6.gem (100%)
Successfully installed molinillo-0.6.6
Fetching: atomos-0.1.3.gem (100%)
Successfully installed atomos-0.1.3
Fetching: CFPropertyList-3.0.2.gem (100%)
Successfully installed CFPropertyList-3.0.2
Fetching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: nanaimo-0.2.6.gem (100%)
Successfully installed nanaimo-0.2.6
Fetching: xcodeproj-1.15.0.gem (100%)
Successfully installed xcodeproj-1.15.0
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: fourflusher-2.3.1.gem (100%)
Successfully installed fourflusher-2.3.1
Fetching: gh_inspector-1.1.3.gem (100%)
Successfully installed gh_inspector-1.1.3
Fetching: ruby-macho-1.4.0.gem (100%)
Successfully installed ruby-macho-1.4.0
Fetching: cocoapods-1.8.4.gem (100%)
Successfully installed cocoapods-1.8.4
Parsing documentation for cocoapods-core-1.8.4
Installing ri documentation for cocoapods-core-1.8.4
Parsing documentation for claide-1.0.3
Installing ri documentation for claide-1.0.3
Parsing documentation for cocoapods-deintegrate-1.0.4
Installing ri documentation for cocoapods-deintegrate-1.0.4
Parsing documentation for cocoapods-downloader-1.3.0
Installing ri documentation for cocoapods-downloader-1.3.0
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-stats-1.1.0
Installing ri documentation for cocoapods-stats-1.1.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.4.1
Installing ri documentation for cocoapods-trunk-1.4.1
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.0
Parsing documentation for molinillo-0.6.6
Installing ri documentation for molinillo-0.6.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for CFPropertyList-3.0.2
Installing ri documentation for CFPropertyList-3.0.2
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for nanaimo-0.2.6
Installing ri documentation for nanaimo-0.2.6
Parsing documentation for xcodeproj-1.15.0
Installing ri documentation for xcodeproj-1.15.0
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for cocoapods-1.8.4
Installing ri documentation for cocoapods-1.8.4
Done installing documentation for cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, netrc, cocoapods-trunk, cocoapods-try, molinillo, atomos, CFPropertyList, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 12 seconds
21 gems installed

Most helpful comment

This should be re-opened, I can repro on a clean Mojave. The workaround is to run sudo gem install cocoapods -v 1.8.4.

All 17 comments

This does not appear to be an issue with CocoaPods rather with your system unable to install the gem:

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 -r ./siteconf20200228-1108-r7oagr.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

Please ask in StackOverflow as I can successfully install CocoaPods 1.9.0 on Mojave.

Mojave 10.14.6 used for this problem is a clear installed environment.

I get the same error here. Also on Mojave 10.14.6.

FWIW, I was just able to install CocoaPods 1.9.0 on Mojave 10.14.6, but I had to upgrade Ruby from 2.3 (whatever was installed) to Ruby 2.6.3.

Could it be that CocoaPods 1.9 requires a higher version of Ruby than what's shipped with Mojave 10.14.6.?

Finally I found a recent case to confirm, I have the same issue on Mojave with the same error message. Mojave is still using Ruby 2.3.7p456, so am I. CocoaPods docs suggest to use default Ruby instead of installing a separate Ruby version. So, was Ruby updated in Catalina and Mojave support got dropped? Many people are still stuck on Mojave for compatibility issues, maybe you should bring support to Ruby 2.3.7p456 as well. @dnkoutso

This should be re-opened, I can repro on a clean Mojave. The workaround is to run sudo gem install cocoapods -v 1.8.4.

This question has been asked on StackOverflow:

And on AskDifferent, the Apple-specific site on Stack Exchange:

Mojave is not some super old OS so it would be beneficial to update the
official installation instructions.

On Sun, Mar 15, 2020 at 1:02 PM Nic Waller notifications@github.com wrote:

This question has been asked on StackOverflow:

And on AskDifferent, the Apple-specific site on Stack Exchange:

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/CocoaPods/CocoaPods/issues/9568#issuecomment-599257226,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEZJS43QQUGDWRXPMT7YITRHUX5JANCNFSM4K47UX2Q
.

This should be re-opened, I can repro on a clean Mojave. The workaround is to run sudo gem install cocoapods -v 1.8.4.

I cannot recall it exactly, but the original reason why I tried to install the latest CocoaPods was I had an Xcode project that was unable to build with the older version of CocoaPods. Don't ask me for details, all I remember was it couldn't resolve references to all Pods, but updating CocoaPods helped, eventually. I still believe CocoaPods should support Mojave a little more instead of suggesting to use an older version of CocoaPods.

Anyways, thanks for clarification.

Can confirm exactly this behavior here as well, latest Mojave, never toyed with the Ruby version...ran it to uprade

@dnkoutso --> I honestly believe this deserves to be re-opened _or_ at least document that Mojave users should use 1.8.4

Same problem on macOS Mojave 10.14.6: sudo gem install cocoapods fails, but sudo gem install cocoapods -v 1.8.4 does work.

xcode-select --install

copy paste the above line in terminal and cocospod will now install with the latest version.

sudo gem install cocoapods

I agree, this should be reopened. The workaround sudo gem install cocoapods -v 1.8.4 worked, but sudo gem install cocoapods did not.

dude read the post above you

xcode-select --install

copy paste the above line in terminal and cocospod will now install with the latest version.

sudo gem install cocoapods

This works for me

sudo gem install cocoapods -n/usr/local/bin -v 1.8.4
USE THIS

sudo gem install cocoapods -n/usr/local/bin -v 1.8.4
USE THIS

This works for me

Was this page helpful?
0 / 5 - 0 ratings