cocopods安装时 Mac os 10.12.1 遇见的问题

在Mac os 10.12.1上安装Cocoapods时遇到了一系列问题,包括错误卸载、源更换、SSL读取错误等。通过逐个卸载Cocoapods相关组件,移除并重新添加gem源,以及使用sudo命令指定路径安装,最终解决了`pod install`时的权限问题和 Specs 仓库克隆失败的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Last login: Tue Oct 25 11:51:04 on ttys000

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods

Password:

Remove executables:

pod, sandbox-pod


in addition to the gem? [Yn]  y

Removing pod

Removing sandbox-pod

Successfully uninstalled cocoapods-1.1.1

pcdeMacBook-Pro:~ lizongyao$ gem list --local | grep cocoapods

cocoapods-core (1.1.1)

cocoapods-deintegrate (1.0.1)

cocoapods-downloader (1.1.2)

cocoapods-plugins (1.0.0)

cocoapods-search (1.0.0)

cocoapods-stats (1.0.0)

cocoapods-trunk (1.1.1)

cocoapods-try (1.1.0)

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-core

Successfully uninstalled cocoapods-core-1.1.1

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-deintegrate

Successfully uninstalled cocoapods-deintegrate-1.0.1

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-downloader

Successfully uninstalled cocoapods-downloader-1.1.2

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-plugins

Successfully uninstalled cocoapods-plugins-1.0.0

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-search

Successfully uninstalled cocoapods-search-1.0.0

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-stats

Successfully uninstalled cocoapods-stats-1.0.0

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-trunk

Successfully uninstalled cocoapods-trunk-1.1.1

pcdeMacBook-Pro:~ lizongyao$ sudo gem uninstall cocoapods-try

Successfully uninstalled cocoapods-try-1.1.0

pcdeMacBook-Pro:~ lizongyao$ gem sources -l

*** CURRENT SOURCES ***


http://rubygems-china.oss.aliyuncs.com

https://ruby.taobao.org/

https://gems.ruby-china.org/

pcdeMacBook-Pro:~ lizongyao$ gem sources --remove http://rubygems-china.oss.aliyuncs.com

http://rubygems-china.oss.aliyuncs.com removed from sources

pcdeMacBook-Pro:~ lizongyao$ gem sources --remove https://gems.ruby-china.org/

https://gems.ruby-china.org/ removed from sources

pcdeMacBook-Pro:~ lizongyao$ gem sources -l

*** CURRENT SOURCES ***


https://ruby.taobao.org/

pcdeMacBook-Pro:~ lizongyao$ sudo gem install cocoapods

Password:

Fetching: cocoapods-try-1.1.0.gem (100%)

Successfully installed cocoapods-try-1.1.0

Fetching: cocoapods-trunk-1.1.1.gem (100%)

Successfully installed cocoapods-trunk-1.1.1

Fetching: cocoapods-stats-1.0.0.gem (100%)

Successfully installed cocoapods-stats-1.0.0

Fetching: cocoapods-search-1.0.0.gem (100%)

Successfully installed cocoapods-search-1.0.0

Fetching: cocoapods-plugins-1.0.0.gem (100%)

Successfully installed cocoapods-plugins-1.0.0

Fetching: cocoapods-downloader-1.1.2.gem (100%)

Successfully installed cocoapods-downloader-1.1.2

Fetching: cocoapods-deintegrate-1.0.1.gem (100%)

Successfully installed cocoapods-deintegrate-1.0.1

Fetching: cocoapods-core-1.1.1.gem (100%)

Successfully installed cocoapods-core-1.1.1

Fetching: cocoapods-1.1.1.gem (100%)

ERROR:  While executing gem ... (Errno::EPERM)

    Operation not permitted - /usr/bin/pod

pcdeMacBook-Pro:~ lizongyao$ sudo gem install -n /usr/local/bin cocoapods 

Successfully installed cocoapods-1.1.1

Parsing documentation for cocoapods-1.1.1

Installing ri documentation for cocoapods-1.1.1

1 gem installed

pcdeMacBook-Pro:~ lizongyao$ 

  [恢复于 2016年10月25日 下午12:32:26]

Last login: Tue Oct 25 12:29:03 on console

Restored session: 2016年10月25日 星期二 12时25分17秒 CST

pcdeMacBook-Pro:~ lizongyao$ pod update

[!] No `Podfile' found in the project directory.

pcdeMacBook-Pro:~ lizongyao$ pod setup

Setting up CocoaPods master repo

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master


Cloning into 'master'...

error: RPC failed; curl 56 SSLRead() return error -36

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed


pcdeMacBook-Pro:~ lizongyao$ xcode-select --print-path

/Applications/Xcode.app/Contents/Developer

pcdeMacBook-Pro:~ lizongyao$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Password:

pcdeMacBook-Pro:~ lizongyao$ pod setup

Setting up CocoaPods master repo

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master


Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -36


pcdeMacBook-Pro:~ lizongyao$ pod setup

Setting up CocoaPods master repo

Setup completed

pcdeMacBook-Pro:~ lizongyao$ cd /Users/pc/Desktop/huashengmifu 

pcdeMacBook-Pro:huashengmifu lizongyao$ pod install

Analyzing dependencies

[!] The dependency `AFNetworking (~> 2.3.1)` is not used in any concrete target.


[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

pcdeMacBook-Pro:huashengmifu lizongyao$ cd /Users/pc/Desktop/huashengmifu 

pcdeMacBook-Pro:huashengmifu lizongyao$ touch Podfile

pcdeMacBook-Pro:huashengmifu lizongyao$ vim Podfile

pcdeMacBook-Pro:huashengmifu lizongyao$ pod install

Analyzing dependencies

[!] The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.

pcdeMacBook-Pro:huashengmifu lizongyao$ pod install

Analyzing dependencies

Downloading dependencies

Installing AFNetworking (3.1.0)

Generating Pods project

Integrating client project


[!] Please close any current Xcode sessions and use `huashengmifu.xcworkspace` for this project from now on.

Sending stats

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

pcdeMacBook-Pro:huashengmifu lizongyao$ 


1.先卸载原来装的cocopods 以及各种文件 
2.查看自己的镜像文件
3.只留下淘宝的镜像
4.sudo gem install cocoapods 重新安装cocopods
5.

ERROR:  While executing gem ... (Errno::EPERM)

    Operation not permitted - /usr/bin/pod

6.sudo gem install -n /usr/local/bin cocoapods 执行此条命令解决问题

7.pod setup

8.

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master


Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -36

9.

xcode-select --print-path

/Applications/Xcode.app/Contents/Developer

10.sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

11.pod setup

12.

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master


Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -36


13.pod setup(等了一晚上)

14.Setup completed




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值