您的位置:首页 > 其它

sudo gem install cocoapods

2016-05-08 14:55 477 查看
在使用IOS_BaiduSDK的时候,需要用到cocoapods,所以就需要按照步骤继续着。但是在过程中会遇到一些问题:

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

RubertdeMacBook-Pro:~ Rubert$ sudo gem install cocoapods
/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
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导致无法下载

RubertdeMacBook-Pro:~ Rubert$ pod setup
/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
Setting up CocoaPods master repo
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --depth=1

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: