sudo gem install cocoapods

在使用IOS_BaiduSDK的时候,需要用到cocoapods,所以就需要按照步骤继续着。但是在过程中会遇到一些问题:

1. sudo gem install cocoapods 运行这个报错

1 RubertdeMacBook-Pro:~ Rubert$ sudo gem install cocoapods
2 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
3 ERROR:  Could not find a valid gem 'cocoapods' (>= 0) in any repository

具体问题答案在这个地址里面找

http://blog.csdn.net/meegomeego/article/details/24005567

http://www.jianshu.com/p/6e5c0f78200a

2. 关于怎么在Podfile中添加 命令:

pod 'BaiduMapKit'

当我直接在项目目录下执行 touch Podfile 命令的时候,然后去目录下面找,并没有找到,然后我就用vi命令打开这个文件,粘贴

pod 'BaiduMapKit',命令如下:

vi Podfile

按下i键,就可以输入了(i 好像是insert的意思)

好了就按esc键,之后就不能输入了。然后再按:wq回车即可。

3.关于安装多个xcode导致无法下载

1 RubertdeMacBook-Pro:~ Rubert$ pod setup
2 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
3 Setting up CocoaPods master repo
4 [!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --depth=1
5 
6 xcrun: error: active developer path ("/Applications/Xcode-beta.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

 其实很简单,执行一条命令即可:

RubertdeMacBook-Pro:ChengDuHidengDangerManage Rubert$ sudo xcode-select -switch /Applications/Xcode-Beta-6.3.app

 

posted on 2016-05-08 14:55  洛易  阅读(2318)  评论(0编辑  收藏  举报