Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity build error: Error running cocoapods

Discussion in 'iOS and tvOS' started by matthewbrand, Feb 21, 2017.

  1. matthewbrand

    matthewbrand

    Joined:
    Jan 9, 2017
    Posts:
    25
    After adding Firebase SDK and trying to build for iOS I get this error in Unity when building:

    "Error running cocoapods. Please ensure you have at least version 1.0.0. You can install cocoapods with the Ruby gem package manager:
    > sudo gem install -n /usr/local/bin cocoapods
    > pod setup

    'pod --version' returned status: 127"

    But I do have cocoapods installed. I gem installed (as sudo and not as sudo), and when I run pod --version I get:
    1.2.0

    Any ideas why this is happening?
     
  2. matthewbrand

    matthewbrand

    Joined:
    Jan 9, 2017
    Posts:
    25
    Any ideas on this? Still stuck here.
     
  3. Knertified

    Knertified

    Joined:
    Jul 3, 2012
    Posts:
    31
  4. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
  5. samuelmorais

    samuelmorais

    Joined:
    Aug 3, 2012
    Posts:
    63
    In my case, I was using Xcode beta, so I just needed to run the command:
    sudo xcode-select --switch /Applications/Xcode-beta.app/
     
    cemyassimo and ShoutTree like this.
  6. paleoAR

    paleoAR

    Joined:
    Aug 27, 2019
    Posts:
    1
    I was sad to run into this error today -- and find no solution on this thread, or other links. I went to /usr/local/bin, like everyone else, typed pod --version and saw a healthy 1.7.5 ... and scratched my head.

    I managed to get a fix (no compiler error any more! and the .xcworkspace file I need to set up ARCore - https://developers.google.com/ar/develop/unity/quickstart-ios - is being generated!).

    What I observed is that if I type `which pod`, i see `~/.rvm/rubies/ruby-2.6.3/bin/pod`... not the `/usr/local/bin/pod` I would expect.... The thing in `/usr/local/bin` didn't seem to be a symlink or hard link, but apparently a different version of the `pod` executable, with the exact same response to `./pod --version`

    I fixed the problem going to `/user/local/bin/`, doing a 'mv pod pod-old' and then `ln -s ~/.rvm/rubies/ruby-2.6.3/bin/pod pod` ... after which I could compile without errors and now I get my .xcworkspace file. I have no idea why this works, but pass it along in the hopes that someone else may be helped.
     
    Petr777 and arfront like this.
  7. ShoutTree

    ShoutTree

    Joined:
    Nov 1, 2013
    Posts:
    5
    My case is the same as samuelmorais. I installed the corresponding xcode command tool and use xcode-select to switch to it, and the error is gone.
     
    samuelmorais likes this.
  8. mrsiwak

    mrsiwak

    Joined:
    Jul 20, 2017
    Posts:
    1
    Hey, I'm running errors with cocopods while attempting to build xcode project to our game. Could you please help and let me know what to do?
    unity 2018.3.6.f1
    macOS Catalina ver. 10.15.1
    xcode Version 11.3


    error 1:
    error 2:
     
  9. ninetytwogamer

    ninetytwogamer

    Joined:
    May 9, 2017
    Posts:
    1
  10. GameSpire

    GameSpire

    Joined:
    Jan 31, 2016
    Posts:
    10
    The problem is outside Unity. You need to run terminal.app in macOS and enter this commands:
    > sudo gem install -n /usr/local/bin cocoapods
    > pod setup
     
  11. bigboer

    bigboer

    Joined:
    Aug 8, 2012
    Posts:
    3
  12. iGAMONIC

    iGAMONIC

    Joined:
    Oct 27, 2017
    Posts:
    16
    @GameSpire i didn't solve my error. i run the commands to install cocoapods via terminal. i got different error in terminal after giving my mac password:

    Error:
    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 ./siteconf20200520-12533-j56cd1.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
     
    nmbileg and Angurvadal like this.
  13. tiagotrigger

    tiagotrigger

    Joined:
    Mar 24, 2015
    Posts:
    4
    Same error for me.

    Running this changes nothing.
    > sudo gem install -n /usr/local/bin cocoapods
    > pod setup

    pod --version returns my installed version just fine.

    @paleoAR answer also did not resolved my problem.
     
    GameLover90 and amoraleite like this.
  14. Carocrazy132

    Carocrazy132

    Joined:
    Aug 16, 2015
    Posts:
    15
    I'm with tiagotrigger, no change here, proper xcode CLT installed and selected.