1.升级Ruby环境
sudo gem update --system接下来会提示密文输入密码(直接输入密码就可以)
2.更换镜像
gem sources --remove https://rubygems.org/
移除现有镜像文件
更新镜像文件
gem source -a https://gems.ruby-china.com淘宝的已经不更新了,用国外的需要翻墙,这就很尴尬
https://gems.ruby-china.com/
查看镜像文件
gem sources -l如果结果是 CURRENT SOURCES https://gems.ruby-china.org/
3、安装CocoaPods
键入以下指令
sudo gem install -n /usr/local/bin cocoapods
运行pod
pod setup当出现 Setup completed 时说明已经完成 #######有时候你可能遇到下面的问题
解决方法:上面错误主要是os10.11+和cocoapods1.0+版本升级的安全机制更改造成的。主要出现在pod setup过程中。且该过程等待时间非常长,所以,你可以在$sudo gem install -n /usr/local/bin cocoapods命令后直接执行$Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 该过程作用与 pod setup作用相同可查看 Enter your link description here:
----项目中添加Pod
1. 新建工程 PodTest
2. 打开终端,cd到 PodTest 根目录
3. 在终端输入 "pod init",会自动创建一个名为 Podfile 的文件
Mac 用RVM配置ruby环境的时候出现错误:
因Mac未安装Homebrew造成的
Homebrew官网:http://brew.sh/index_zh-cn.html
安装 Homebrew
/bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
rvm