ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension
Asked Answered
F

40

326

I am trying to install cocoapods to my MacBook Pro running with OSX 10.9.1 (new Mavericks) and after type gem install cocoapods I get the following error:

    Building native extensions.  This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

        "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby" -rubygems /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.1.1/bin/rake RUBYARCHDIR=/Users/rangreenberg/gems/gems/xcodeproj-0.14.1/ext RUBYLIBDIR=/Users/rangreenberg/gems/gems/xcodeproj-0.14.1/ext
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for -std=c99 option to compiler... *** 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
    --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=/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
    from extconf.rb:24:in `block in <main>'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from extconf.rb:23:in `<main>'
rake aborted!
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/...]

Tasks: TOP => default => ext
(See full trace by running task with --trace)


Gem files will remain installed in /Users/rangreenberg/gems/gems/xcodeproj-0.14.1 for inspection.
Results logged to /Users/rangreenberg/gems/gems/xcodeproj-0.14.1/ext/xcodeproj/gem_make.out
Flute answered 5/1, 2014 at 21:42 Comment(1)
Try to switch ruby to homebrew version. brew install ruby brew link --overwrite ruby If you need to have ruby first in your PATH run: echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile For compilers to find ruby you may need to set: export LDFLAGS="-L/usr/local/opt/ruby/lib" export CPPFLAGS="-I/usr/local/opt/ruby/include" For pkg-config to find ruby you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"Funda
A
603

Run following command

 brew cleanup -d -v 

Then run below command

brew install cocoapods 

Note: If you see failed to link then run brew link cocoapods

If linking is getting failed then run

brew link --overwrite cocoapods

This is how it get solved for me

For someone who is having m1 chip system they need to run this via Rosetta

select Terminal and press cmd(⌘)+I and check the "Open using Rosetta" option. ( For m1 chip based mac )

Awlwort answered 7/5, 2020 at 12:43 Comment(10)
Yes. After an hour of trying to update things with rvm and gem, trying with brew worked like charm. Thanks!Dogmatism
After using 'brew link cocoapods' to fix link error, I occurred another error 'Could not symlink bin/pod'. I fix the symlink error by run 'brew link --overwrite cocoapods'.Jeanajeanbaptiste
if "brew link cocoapods" FAILED, use: brew link --overwrite cocoapodsJoseph
I was getting an installation error while trying to install using gem (ruby), but with homebrew it's working fine.Norenenorfleet
Apparently cocopods has been removed from Homebrew. I ran the suggested command. The console returned this: ==> Searching for similarly named formulae... Error: No similarly named formulae found. Error: No available formula or cask with the name "cocopods". ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.Plasmo
In my case I needed to install HomeBrew First, follow instruciontions on (brew.sh), then run brew install cocoapods, after changing some root permissions, (following brew installation)Db
Works for me. I just need to export new path in ~/.bash_profile: export PATH="$PATH:/usr/local/Cellar/cocoapods/1.11.2_1/bin"Frothy
If you have some problem or error of lack of permission you need to execute some commands. I found this site that solved my problem: stdworkflow.com/386/…Dympha
It did work for me with brew link --overwrite cocoapods at the end. 👌Loveliesbleeding
Use which pod to verify installation. Was previously mistakenly trying which cocoapods.Offcolor
S
147

First, check the version of Ruby you are using.

$ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
$ which ruby
usr/bin/ruby

Now use Homebrew to install the latest Ruby.

$ brew install ruby
==> ruby
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/2.7.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH run:

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/xxx/.bash_profile

For compilers to find ruby you may need to set:

$ export LDFLAGS="-L/usr/local/opt/ruby/lib"
$ export CPPFLAGS="-I/usr/local/opt/ruby/include"

Follow the instructions to set PATH. Now you will go to see the installed Ruby. Make sure to replace the 'xxx' with your username.

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/xxx/.bash_profile
$ echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
$ echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile

$ source ~/.bash_profile

Finally, Make sure your PATH is in place.

$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
$ which ruby
/usr/local/opt/ruby/bin/ruby

You're good to go! Make sure you install by specifying the save destination as follows.

$ sudo gem install -n /usr/local/bin cocoapods
Sheriesherif answered 3/7, 2020 at 0:10 Comment(8)
Worked for my MacOS Catalina 10.15.7. Thank you so much!Segregationist
Worked for me also MacOs Big Sur 11.0.1. Thanks very much, bro you saved me. I have searched a lot for about 4 hours. You saved me Thanks agaian.Wessex
Worked for my MacOS Catalina 10.15.7, thanks a lotTonettetoney
After spending almost 2 days to figure this out, finally this solution worked!Carr
Something is wrong with my path on MacOS Catalina 10.15.7 I have check with below command which ruby /Users/ashish.chaudhary/.rvm/rubies/ruby-3.0.1/bin/ruby Still the issue is same for me. Issue could be the path of my ruby?Kauppi
@Kauppi yes it seems like. Try to uninstall ruby completely and re-install using brew.Sheriesherif
Worked perfectly. Thank youHufnagel
Worked Perfectly.Goldy
S
74

You need to install Xcode's developer tools. The easiest way to do this is through terminal (this question)

xcode-select --install
Sorn answered 5/1, 2014 at 21:57 Comment(11)
When i type your suggestion i get 'Can't install the software because it is not currently available from the Software Update server.' :/Flute
Try the other option from the developer website.Sorn
Already did, same problem, can't get the Command line tool, see this: discussions.apple.com/message/23822686#23822686Flute
I guess wait until Apple fixes their server... not much else to do. Sorry mate.Sorn
If the download does start initializing for you make sure you restart your computer before you run the "sudo gem install cocoapods" in terminal.Check
You can download the Command Line Tool manually from developer.apple.com/downloads/index.actionLonnalonnard
This didn't help me. "xcode-select: error: command line tools are already installed, use "Software Update" to install updates"Ramachandra
Can you tell us why is this needed? And how did you figure it out?Czechoslovak
Macs come installed with Ruby, but it's a very old version of Ruby that often is incompatible with later programs. Cocoapods (and podfiles themselves actually) are written in ruby and the "Failed to build gem native extension" is a fairly common error. As for how I figured it out, the error message actually suggests the solution with "The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first."Sorn
This should be the top answer. It was all I had to do to get it working, no brew, no Rosetta Terminal.Bosch
xcode-select --install xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updatesTadzhik
B
23

if you're also seeing error: active developer path .. does not exist you may also have to do this

$ sudo xcode-select --reset
Burlie answered 22/10, 2019 at 11:45 Comment(2)
tried many things, set the xode command line tool manually, updated ruby, updated macOS but nothing worked. But this simple command fixed it. Thanks a lot.Anticyclone
I have tried 100 of other things but nothing worked but this worked perfectly fine.Mukul
E
22

If none of above works then follow these steps

  1. sudo xcode-select --switch /Library/Developer/CommandLineTools
  2. sudo gem install cocoapods

If you get error like this

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory

then go to step 3:

  1. $ sudo gem install -n /usr/local/bin cocoapods
Exegesis answered 20/11, 2020 at 15:31 Comment(0)
M
19
brew reinstall ruby

Add the below to your path

export PATH="/usr/local/opt/ruby/bin:$PATH"

If needed add these flags.

export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
Misogynist answered 12/5, 2020 at 5:32 Comment(0)
T
18

Update your gem tool first. This might take a while

sudo gem update --system

Use this instead

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

Latest CocoaPods 1.10.0 won't work.

you can verify the version with

pod --version
Tendinous answered 22/1, 2021 at 0:38 Comment(1)
why latest version of cocoapods is not working any idea??Wonderland
H
12

ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension

First install the Ruby Version Manager rvm:

curl -L https://get.rvm.io | bash -s stable

Then use

source ~/.rvm/scripts/rvm 

Then install the latest version of ruby:

rvm install ruby-2.7.2

Then flow this (your Terminal) output Next step:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/nec/.zprofile 

Then use

eval "$(/opt/homebrew/bin/brew shellenv)"

Finally try again to install the cocoapods:

sudo gem install cocoapods
Horvath answered 6/9, 2022 at 11:23 Comment(3)
I solved the problem using the above commands .Horvath
Can you clarify the /Users/nec/.zprofile directory? I'm assuming this is just whatever bash profile or whatever we use? I added the eval command to my .bashrc & .zprofile for good measure, but I'm not familiar with .zprofile, so not sure if it's necessary to have it in both?Cystotomy
.zprofile file path show your terminal output .Horvath
S
9

I fixed the problem by using ruby 2.0 (which is the preferred way on mavericks) or greater. In case you are using rvm just change to the correct ruby with:

rvm use ruby-2.0

After that gem install cocoapods worked correctly. To be more specific, I was using:

OSX 10.9.2
ruby-2.0.0-p353
cocoapods-0.32.1
Selfemployed answered 21/4, 2014 at 12:30 Comment(0)
H
9

This command saved my day

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

To be confirmed check the pod version

pod --version
Hendrickson answered 8/4, 2021 at 8:47 Comment(0)
N
7

I also had the same problem. This is probably happening because your computer has older version of ruby. So you need to first update your ruby. Mine worked for ruby 2.6.3 version

You need to first open terminal and put this code

curl -L https://get.rvm.io | bash -s stable

Then put this command

rvm install ruby-2.6.3

This would install the ruby for you if it hasn' t been installed.After this just update the ruby to the new version

rvm use ruby-2.6.3

After this just make ruby 2.6.3 your default

rvm --default use 2.6.3

This would possibly fix your issue. You can now put the command

sudo gem install cocoapods

And the command

pod setup
Norenenorfleet answered 13/2, 2021 at 7:58 Comment(0)
J
6

First as wrote "Kevin" try to run in terminal:

xcode-select --install

If it doesn't help you download tools manually from apple developer site:

It helped me.

Jehias answered 4/7, 2014 at 15:5 Comment(0)
O
5

My way to solved:

First of all, i have new mac os 10.15.7 and Xcode

None of previous solutions worked for me too

I note that pods install in Library 2.6.0 and decided that it needs to be updated:

step 1

\curl -sSL https://get.rvm.io | bash -s stable --ruby

Ok!

Then i checked version: 2.6.0 - Why? In last string after install ruby, i noticed:

  • To start using RVM you need to run source /Users/abazhanov/.rvm/scripts/rvm in all your open shell windows, in rare cases you need to reopen all shell windows.

ok, let's do it:

step 2

source /Users/abazhanov/.rvm/scripts/rvm

Then i checked version: 2.7.0 - its ok!

step 3

sudo gem install cocoapods 

As a result: 34 gems installed

I understand that the new version of Pods simply did not install on the old version of Ruby

Occupation answered 15/11, 2020 at 7:2 Comment(0)
V
5

Open Terminal

xcode-select --install
sudo xcodebuild -license accept
curl -L https://get.rvm.io | bash -s stable

Close and Reopen Terminal

rvm install ruby-2.6

sudo gem install cocoapods
pod install 

After completing right click on project top-left on android studio then click on Flutter -> Open IOS Module in Xcode

Verda answered 20/1, 2021 at 11:30 Comment(0)
S
4

First install Homebrew if you don't have it: https://brew.sh/index_pt-br

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Second, install ruby if you don't have it: https://www.ruby-lang.org/pt/documentation/installation/

brew install ruby

You can also follow these steps: https://gist.github.com/monicao/d372716cdfbb7e9cf692

Then, close your terminal and reopen it again.

Always use sudo to install cocoapods:

sudo gem install cocoapods
Sonnysonobuoy answered 15/5, 2020 at 14:49 Comment(0)
E
4

Sometimes the issue is that your xcode tools version is too low. Try running these commands if you already haven't

sudo rm -rf /Library/Developer/CommandLineTools

xcode-select --install

sudo xcodebuild -license accept

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Elative answered 30/6, 2020 at 0:41 Comment(0)
C
3

i had this issue when i tryed to install cocoapods by running

sudo gem install cocoapods

but i was able to install it with no problems using brew

Credit answered 18/11, 2020 at 23:14 Comment(4)
Please share the code that you ran using brew. It will be helpful to show different solutions to the problem.Scatterbrain
just run "brew install cocoapods". if you don't have brew installed on your machine you can see the installation guide on their websiteLauds
This worked after having an error with 'sudo gem install cocoapods' As others have mentioned, use HomeBrew: brew install cocoapods A 2nd error: 'Could not symlink bin/xcodeproj' Do this: rm '/usr/local/bin/xcodeproj' -> yes at prompt. Then run: 'brew link --overwrite cocoapods' Run flutter doctor VSCode extension. You should see successful install.Sisterly
That worked perfectly with no errors, thanks mate.Personality
G
3

After trying various things Tosin Sotannde's method work for me first run this

sudo gem update --system

then

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Goblin answered 1/3, 2021 at 14:34 Comment(0)
L
3

If you installed it through Brew, you can solve it with a simple command.

brew update

brew upgrade
Lalia answered 6/12, 2021 at 5:16 Comment(0)
D
2

I fix the problem by follow step:

1:rvm install 2.0.0

2:rvm list * ruby-1.9.3-p545 [ x86_64 ] => ruby-2.0.0-p451 [ x86_64 ]

3:rvm 2.0.0 —default

4:pod update

Dissimilarity answered 8/5, 2014 at 9:4 Comment(0)
M
2

Alright,

I had the same issue. Tried to install pods to my project but never worked out. I updated Xcode, Updated Command Line tools, reinstalled cocoapods... almost everything.

Sitting on my ass , writing pod in terminal showed up a screen listing available commands.

I read all of them and noticed the command

pod setup

which does

+ setup               Setup the CocoaPods environment

After this line of code, my problem was fixed.

I hope my solution help other people in trouble like me.

Maritamaritain answered 21/11, 2014 at 13:30 Comment(0)
M
2

I was getting this error and had to completely reinstall cocoapods to fix it. Finally worked. Maybe this solution suits for anyone else.

sudo rm -rf home_folder/.cocoapods/

After that, did again

pod setup

and installed my libraries from zero, and everything worked.

Malignity answered 1/12, 2014 at 16:23 Comment(0)
M
2

I suppose you have run a gem update before installing the cocoapods gem, so all your gems should be updated.

That message is a new warning introduced with XCode 5.1, that now threats unknown parameters as errors. You didn't specify which version of cocoapods and XCode you are using, but my guess is that there is a mismatch between the two. Maybe Xcode is too old? You are installing a brand new cocoapods so at least that should be the latest available.

Instead of updating XCode, you could try disabling that warning and hope that the compilation completes successfully setting an environment variable just before installing cocoapods, with this:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install cocoapods
Meza answered 10/6, 2015 at 5:58 Comment(0)
P
2

try to install cocoapods using brew. i found it here Apple

Try

brew install cocoapods

it will get cocoapods installed without this error.

enter image description here

Performative answered 31/1, 2021 at 14:19 Comment(0)
R
1

I was having the same exact problem, although I had the latest version of the xcode command-line tools.

If you have homebrew installed, do brew install apple-gcc42. This immediately solved it for me.

Rochette answered 4/3, 2014 at 10:55 Comment(2)
Error: No available formula for apple-gcc42Hangeron
brew install homebrew/dupes/apple-gcc42Loveinidleness
S
1

I follow this steps to install Cocoapods. May be it useful for you.

  1. Open Terminal
  2. gem install cocoapods
  3. pod setup
Signal answered 10/6, 2015 at 6:8 Comment(0)
S
1

I got same problem and I just fixed with change my /usr/local/include folder to /usr/local/include_old

Sap answered 10/3, 2020 at 9:7 Comment(0)
W
1

I was facing quite a similar error, and it was my first time installing CocoaPods on macOS Catalina. Finally managed by installing Xcode Commandline Tools. Type in the following command into your Terminal. (As of this day, this file is around 248.3mb)

xcode-select --install

A dialog should appear asking you to approve the download and installation. It might take a while to download depending on your internet speed. Once the installation is successful. Attempt to install CocoaPods once more with the following command in Terminal.

sudo gem install cocoapods

Once complete use the following command to confirm if installation was successful

pod setup --verbose
Woke answered 16/4, 2020 at 9:8 Comment(0)
O
1

Worked for me in 2020 (Mac OS Catalina)

xcode-select --install

sudo gem install -n /usr/local/bin cocoapods
Office answered 27/4, 2020 at 5:37 Comment(0)
S
1

I faced same issue on macOS Catalina. Even though Installing with Homebrew worked, I was just curious why gem install cocoapods fails, even it is the preferred or mentioned method of installation in their official documentation.

I tried almost all solutions above and may be some other too, I found while googling the issue.

Finally today I deleted the Xcode 12.4, I have, and installed again, actually for some other reason. Just for curiosity, I tried gem install cocoapods again, and now it got worked, and installed cocoapods, the same way mentioned in the official documentation.

Selfgovernment answered 10/7, 2021 at 7:1 Comment(0)
M
0

You must use the command in Terminal for installing Command Line Tools:

xcode-select --install

If you receive the message as a result of "Can't install the software because it is not currently available from the Software Update server.", You must download manually Command Line Tools from Apple site.

Masque answered 28/6, 2014 at 15:49 Comment(0)
S
0

I had multiple environments in my configuration, which was causing problems as rvm was interfering with the installation. Once ruby 2.x was detected the install went fine.

For my environment I did the following: 1. xcode-select --install 2. rvm implode (Note - too drastic - you may not need to do this, I didn't have any use for the older ruby installations, I removed them via rvm uninstall one-by-one and then used rvm implode 3. gem install cocoapods

This time the last command worked without any issues.

Significance answered 2/7, 2014 at 23:1 Comment(0)
H
0

The same initial issue occurred when attempting to setup GoogleMaps in a Flutter app after running pod install on the iOS directory.

Running pod install the following error appeared:

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

Next, after running sudo gem install cocoapods that resulted in another error similar to that shown at ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.

ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

kevin recommends installing Xcode Developer Tools running:

xcode-select --install

and while highlighting the need to install the tools, the system again produced the same error as before when running the pod install command.

Refresing the tools by removing and reinstalling them became the next target. The tools are removed with the following command:

rm -rf /Library/Developer/CommandLineTools

And again installing the xcode developer tools using:

xcode-select --install

Then, sudo gem install cocoapods and pod install ran successfully.

Histopathology answered 23/3, 2020 at 9:24 Comment(0)
S
0

None of previous solutions worked for me...

My situation is a fresh clean install of macOS Catalina + XCODE;

It happen that I had to first run Xcode before install cocoa pods (in first run, Xcode setups machine with tools);

After that, cocoa pods worked fine.

Serviceable answered 6/4, 2020 at 13:21 Comment(0)
M
0

This should unshallow both the cask and the core repo.

brew tap homebrew/cask

followed by...

brew tap homebrew/core
Materi answered 4/1, 2021 at 11:2 Comment(0)
S
0

I have same issue, cocoapods was not installing and waste 3 to 4 hours to get solve this error and finally I got the solution,

step1: open the terminal and run "brew reinstall ruby" and terminal will guide you how to export the path step2: and then run "sudo gem install cocoapods"

Solubility answered 26/1, 2021 at 12:2 Comment(0)
I
0

The problem is outside Unity. You need to run the terminal and enter this commands:

sudo gem install -n /usr/local/bin cocoapods
pod setup

This saved my day !

Inae answered 29/7, 2021 at 10:3 Comment(0)
I
0

Mac Monterey 12.5, follow these steps work for me

1. sudo xcode-select --install
2. sudo xcode-select --reset
Illyes answered 10/8, 2022 at 2:35 Comment(0)
I
0

Same error for me, due to old version ruby:

 ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

Follow worked for me (macOS 11.5.2 Big Sur):

  1. install GPG key
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
  1. install nvm (and using nvm install new version ruby)
curl -sSL https://get.rvm.io | bash -s stable --ruby

here installed version:

 nvm --version
0.30.1

 ruby --version
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]

 which ruby
/Users/crifan/.rvm/rubies/ruby-3.0.0/bin/ruby

 gem --version
3.2.3
  1. use gem to install cocoapods
sudo gem install cocoapods

installed version:

 which pod
/Users/crifan/.rvm/rubies/ruby-3.0.0/bin/pod
 pod --version
1.11.3

  • Note

using homebrew install cocoapods

brew install cocoapods

is ok for me, but the version is relative old:

~  pod --version
1.10.1

and here for development need latest version cocoapods, so need using gem to install the latest cocoadpods.

Ibrahim answered 16/8, 2022 at 13:43 Comment(0)
D
-1

1.Update Brew

brew update

2.Install Cocoapods

brew install cocoapods

Dramshop answered 24/3, 2022 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.