Search Unity

Failed to install Cocoapods

Discussion in 'iOS and tvOS' started by javaBroker, Aug 23, 2017.

  1. javaBroker

    javaBroker

    Joined:
    Jun 14, 2017
    Posts:
    11
    Hello,
    I'm using Unity 5.2.4f and I have installed ruby 1.9.3 on my old Mac with Lion OS X 10.7.5 system on it.
    When I open Unity project there is an installation attempt which failing and I don't know how to solve this, after trying few days. Here is the error I get:

    Code (CSharp):
    1. IOS RESOLVER
    2.  
    3. Failed to install Cocoapods for the current user.
    4.  
    5. It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application.
    6.  
    7. For more information see:
    8.   https://guides.cocoapods.org/using/getting-started.html
    9.  
    10.  
    11. 'gem install activesupport -v 4.2.6 --user-install' failed with code (1):
    12.  
    13.  
    14. WARNING:  You don't have /Users/DAN26/.gem/ruby/1.8/bin in your PATH,
    15.     gem executables will not run.
    16. ERROR:  Error installing activesupport:
    17.   i18n requires Ruby version >= 1.9.3.
    18.  
    So I go to the Terminal and do the following:
    Code (CSharp):
    1. export PATH="/Users/DAN26/.gem/ruby/1.9.3/bin:$PATH"
    No change. So I do this:
    Code (CSharp):
    1. export PATH="/Users/DAN26/.gem/ruby/1.8/bin:$PATH"
    Still get the same message...

    Enter $PATH

    Code (CSharp):
    1. -bash: /usr/local/opt/openssl/bin:/Users/DAN26/.rbenv/bin:/Users/DAN26/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/DAN26/.rvm/bin: No such file or directory
    Also if I enter in the Terminal:
    Code (CSharp):
    1. gem list
    I get this:

    Code (CSharp):
    1. *** LOCAL GEMS ***
    2.  
    3. activesupport (4.2.9)
    4. bigdecimal (1.1.0)
    5. fuzzy_match (2.0.4)
    6. i18n (0.8.6)
    7. io-console (0.3)
    8. json (1.5.5)
    9. minitest (5.10.3, 2.5.1)
    10. nap (1.1.0)
    11. rake (0.9.2.2)
    12. rdoc (3.9.5)
    13. thread_safe (0.3.6)
    14. tzinfo (1.2.3)
    15.  


    Please help me to solve this problem
    Thanks

    EDIT:
    I have installed activesupport 4.2.5 and cocoapods 0.34.4 but no change.
    Code (CSharp):
    1. *** LOCAL GEMS ***
    2.  
    3. activesupport (4.2.9, 4.2.6, 4.2.5, 3.2.22.5)
    4. bigdecimal (1.1.0)
    5. claide (0.7.0)
    6. cocoapods (0.34.4)
    7. cocoapods-core (0.34.4)
    8. cocoapods-downloader (0.7.2)
    9. cocoapods-plugins (0.3.2)
    10. cocoapods-trunk (0.3.1)
    11. cocoapods-try (0.4.5)
    12. colored (1.2)
    13. escape (0.0.4)
    14. fuzzy_match (2.0.4)
    15. i18n (0.8.6)
    16. io-console (0.3)
    17. json (1.8.6, 1.5.5)
    18. json_pure (1.8.6)
    19. minitest (5.10.3, 2.5.1)
    20. multi_json (1.12.1)
    21. nap (1.1.0, 0.8.0)
    22. netrc (0.7.8)
    23. open4 (1.3.4)
    24. rake (0.9.2.2)
    25. rdoc (3.9.5)
    26. thread_safe (0.3.6)
    27. tzinfo (1.2.3)
    28. xcodeproj (0.19.4)
    29.  
     
    Last edited: Aug 23, 2017
  2. DaNiELChIoRo

    DaNiELChIoRo

    Joined:
    Dec 12, 2018
    Posts:
    1
    Well, since I were using Google Drive File Stream directory I found that cocoa pods are uncompatible to this folder system. So I change the build's folder from Unity's build settings and that's it!
    Hope you have already found a solution
     
  3. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    i am facing the sam error, Any solution ?

    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 ' failed with code (1):


    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /Users/deepan/.gem/ruby/2.3.0/specifications/fuzzy_match-2.0.4.gemspec:17.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /Users/deepan/.gem/ruby/2.3.0/specifications/i18n-0.9.5.gemspec:17.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /Users/deepan/.gem/ruby/2.3.0/specifications/i18n-0.9.5.gemspec:17.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /Users/deepan/.gem/ruby/2.3.0/specifications/fuzzy_match-2.0.4.gemspec:17.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /System/Library/Frameworks/Ruby.framework/Versions/
     
  4. bruno1308

    bruno1308

    Joined:
    Aug 25, 2016
    Posts:
    4
    I manually ran
    'gem install cocoapods'

    in my unity project folder, and it stopped happening
     
  5. MTod

    MTod

    Joined:
    Jul 31, 2019
    Posts:
    1
    I had the issue on a new install of mac os / unity / xcode. What solved it for me was to just run XCode manually once, and it installed everything that it needed.
     
    HappenLabs and jasonsurratt like this.
  6. ExNinja

    ExNinja

    Joined:
    Dec 4, 2013
    Posts:
    30
    In order to get the cocoapods to run/install properly, I also needed to allow my user to make changes to /Library/Ruby/ on macOS. If you run into this same issue on macOS, do not try using chmod to change permissions on /Library/Ruby/. There is a better way on macOS.

    To give yourself change permissions on /Library/Ruby/:
    1. Open the Terminal application. (Press Command-Space, then type Terminal, and hit return.)
    2. In Terminal, at the prompt, type cd /Library and press return. This moves you into the /Library folder in Terminal.
    3. In Terminal, type open . (which is the word open followed by a space and a period) and press return. This will open the /Library folder in your Finder. It's usually hidden from you, which is why we needed to go into Terminal.
    4. In Library, you will find a folder named Ruby.
    5. Right click on the Ruby folder and select Get Info. (Or Left click the Ruby folder to select it and press Command-i.)
    6. Click the lock at the bottom of the Get Info window to unlock it. You will need to type in your login password for the computer and will need to have admin privileges.
    7. Click the + at the bottom left of the Get Info window and add your user with Read & Write permissions.
    8. That's it!
     
  7. UNSH

    UNSH

    Joined:
    Jul 2, 2012
    Posts:
    51
    Ridiculous as it was I lost a lot of time on this. This fixed it in my case just set the CLT in Xcode and run again.
    1. Select Command Line Tools in XCode.
      XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
    Taken from here https://stackoverflow.com/a/60464653
     
    Ditronian, xinatcg, AquaGhost and 8 others like this.
  8. ashiokai

    ashiokai

    Joined:
    Aug 5, 2015
    Posts:
    6
  9. vrerabek

    vrerabek

    Joined:
    Dec 21, 2016
    Posts:
    1

    This has worked for me!
     
  10. cerman123

    cerman123

    Joined:
    Mar 22, 2020
    Posts:
    11
    Thank you so much for your support. It works :)
     
  11. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81
    Hey - i have the same Problem but nothing seems to work.
    I have unpacked the Facebook Analytics package into a test Unity project and everything was working fine. Then i have done the same on my working project and i get this errors. The Dummy project opens and runs and my working project fails.

    iOS Resolver:
    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.
     
    zipsted likes this.
  12. krenar_

    krenar_

    Joined:
    Dec 11, 2020
    Posts:
    10
    @Smileys Any solution?
     
  13. leonliu75

    leonliu75

    Joined:
    Jun 18, 2020
    Posts:
    5
    this works for me on MacOS Big Sur, it looks like that Unity scripts could not find the ruby path correctly.
     
  14. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    This one worked for me on Big Sur.
    sudo gem install cocoapods -n /usr/local/bin
    It was looking in the old place, and when i checked my pods version, it was the old version I hadn't installed manually. So doing this made it install where Unity is looking for it.
     
    rhodnius likes this.
  15. zzstarsound

    zzstarsound

    Joined:
    Dec 10, 2018
    Posts:
    1
    I solved this issue by installing cocoapods manually(sudo gem install cocoapods -n /usr/local/bin)
    AND UNCHECK the following 2 options that you can find through Asset->External Dependency Manager->iOS Resolver->Settings
    Use Shell to Execute Cocoapods Tool
    Auto Install Cocoapods Tools in Editor

    Seems Unity still try to install cocoapods even if you have already installed cocoapods, and there are also something wrong when calling cocoapods via Shell.

    Hope this may help someone.
     
    kirill_unity340 likes this.
  16. xanaramus

    xanaramus

    Joined:
    Sep 21, 2018
    Posts:
    4
    Solved by executing XCODE first time.
     
    Clovis974 and FlyingSquirrels like this.
  17. ilievant

    ilievant

    Joined:
    Aug 10, 2022
    Posts:
    2
    I have a similar problem. The main problem was the right PATH to Ruby and cocoapods, because Unity uses bash shell but on my mac terminal was zshrc shell. These two shells don't share paths configuration files and you need to set the Unity-bash shell configuration file to work properly with the right Path.
     
  18. Kenneth_ION

    Kenneth_ION

    Joined:
    Jul 17, 2013
    Posts:
    4
    This worked for me:

    Depending on some aspects this might work for you, if you don't mind using the "SUDO" command:

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

    Latest CocoaPods 1.10.0 won't work.

    Thanks to Fluttering (https://developer.apple.com/forums/profile/Fluttering)
     
    respectyoda likes this.
  19. VANDER25

    VANDER25

    Joined:
    Jan 19, 2021
    Posts:
    2
  20. won-gyu

    won-gyu

    Joined:
    Mar 23, 2018
    Posts:
    35
    adding these lines in .bash_profile solved it for me

    export PATH=/usr/bin:$PATH
    export GEM_HOME=$HOME/.gem
    export PATH=$GEM_HOME/bin:$PATH
     
  21. respectyoda

    respectyoda

    Joined:
    Apr 27, 2018
    Posts:
    11
    This Terminal command works!
     
  22. SurajKamya

    SurajKamya

    Joined:
    Dec 16, 2021
    Posts:
    8
    I had same issue with new Mac M1 Air, ruby's older version was creating issues.

    It resolved for me


    Many Thanks to the guy
     
    andreiagmu likes this.
  23. Trunksome

    Trunksome

    Joined:
    Jan 28, 2022
    Posts:
    17
    This is so annoying. The iOS resolvers keeps trying to install cocoapods and fails at it. The thing is i already have cocoapods installed and its working fine; I tried disabling auto-install in the resolver settings, but it just resets my settings and keep trying again and again. And the way the resolver popup works is that its interrupting whatever i'm currently doing in Unity.
     
  24. Trunksome

    Trunksome

    Joined:
    Jan 28, 2022
    Posts:
    17
    Thank you for the hint, that's what solved it for me. I created .bash_profile in my home directory, put in "source ~/.zprofile", restarted Unity completely and the error is gone!
     
    BlinkqOdeeo likes this.
  25. Evaldas_Unity

    Evaldas_Unity

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    85
    Unity has no code for CocoaPods.
    So the PATH issue (if that is the issue) is caused by your dependency manager (i.e EDM4U)
    So I'd suggest making a bug report to them
     
    Trunksome likes this.