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
  3. Dismiss Notice

Error installing Cocoapods

Discussion in 'General Discussion' started by dyach3579, Dec 26, 2020.

  1. dyach3579

    dyach3579

    Joined:
    Jan 3, 2018
    Posts:
    22
    Hi everyone, Im having issues finding solutions to this online. Im trying to get cocoaspods installed into my unity project for IOS. I've been trying all sorts of solutions that are on the unity forums, stackoverflow, etc, and I also tried doing the sudo gem install cocoapods in the Terminal, but it keeps failing and I can't figure out why. I have the latest version of Xcode installed too. Can anyone help me with a solution to this error of failing to install cocoaspods? I appreciate any help.

    Here’s the error I get, and this is after I installed the Google Admob package from Github and imported it into my IOS project for Unity.

    WARNING: You don't have /Users/dyach/.gem/ruby/2.6.0/bin in your PATH,
    gem executables will not run.
    ERROR: Error installing cocoapods:
    ERROR: Failed to build gem native extension.


    In the inspector I get more of the error coming up. It says:

    Failed to install CocoaPods for the current user.

    It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application.

    For more information see:
    https://guides.cocoapods.org/using/getting-started.html


    'gem install cocoapods --user-install' failed with code (1):
    Building native extensions. This could take a while...
    Users/dyach/.gem/ruby/2.6.0/gems/ffi-1.14.2/ext/ffi_c
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf2020126-5604-knuzif.rb extconf.rb
    checking for ffi.h... *** extconf.rb failed ***

    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.
    Check the mkmf.log file for more details. You may
    need configuration options.

    Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --enable-system-libffi
    --disable-system-libffi
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file.
     
  2. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,571
  3. dyach3579

    dyach3579

    Joined:
    Jan 3, 2018
    Posts:
    22
  4. FKemp

    FKemp

    Joined:
    Jan 4, 2021
    Posts:
    1
    So did you check the log file? Maybe you're missing a necessary library.