Setting up CocoaPods master repo (Sierra )

倾然丶 夕夏残阳落幕 提交于 2019-12-18 09:45:28

问题


After upgrading to Sierra 10.12, doing a clean install from scratch, I am not able to install libraries using cocoapods, by making the "pod install" I get this: "Setting up CocoaPods repo master". I hope you can help me. Thank you.


回答1:


In my first installation, I got the same problem too, it takes too much time in "setting up master repo". You can see it through "activity monitor" that it actually is downloading, but it seems the connection is slow from their server.

Try these following steps, it solves my problem:

1. pod setup

It will do " setting up master " again, don't wait, continue these steps below

2. Ctrl +C
3. pod repo remove master
4. cd ~/.cocoapods/repos 
5. git clone --depth 1 https://github.com/CocoaPods/Specs.git master

It takes around 5 minutes for me (I think it depends on internet connection), then I can do "pod install".




回答2:


install CocoaPods

sudo gem install cocoapods

If it throw error like this

ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod

you can try again in this way:

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

if it even throw error like :

ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.

then check the ruby version

ruby -v

if logs:

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

that means you need to update ruby

rvm list known

if logs:

command not found

then you should:

curl -L get.rvm.io | bash -s stable

rvm install 2.2.2

if logs:

Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.12/x86_64/ruby-2.2.2. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Missing required packages: autoconf automake libtool pkg-config libyaml readline libksba openssl Somehow it happened there is no executable 'openssl', run 'brew doctor' and make sure latest '' is installed properly. Requirements installation successful. Installing Ruby from source to: /Users/mac/.rvm/rubies/ruby-2.2.2, this may take a while depending on your cpu(s)... ruby-2.2.2 - #downloading ruby-2.2.2, this may take a while depending on your connection...

then you should:

 rvm autolibs read-only
 rvm install 2.2.2

You can install now:

pod install


来源:https://stackoverflow.com/questions/39807776/setting-up-cocoapods-master-repo-sierra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!