1.安装Pod
打开终端输入下面的命令
sudo gem install cocoapods
会提示输入密码。输入管理员密码即可自动安装
关于ruby的升级
国内用户设置仓库使用 https://gems.ruby-china.com/
查看本机的ruby仓库 在终端输入命令
gem sources -l
仓库的移除
gem sources --remove 要移除的仓库地址
类似
gem sources --remove http://rubygems.org/
添加
gem source --a 地址
gem source -a https://gems.ruby-china.com/
查看可用的ruby版本
rvm list known
出现各版本的ruby
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.5]
[ruby-]2.5[.3]
[ruby-]2.6[.0]
ruby-head
# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2
# JRuby
jruby-1.6[.8]
jruby-1.7[.27]
jruby-9.1[.17.0]
jruby[-9.2.5.0]
jruby-head
# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx-3[.100]
rbx-head
# TruffleRuby
truffleruby[-1.0.0-rc10]
# Opal
opal
# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
mruby-1.3.0
mruby-1[.4.1]
mruby-2[.0.0]
mruby[-head]
# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]
# Topaz
topaz
# MagLev
maglev-1.0.0
maglev-1.1[RC1]
maglev[-1.2Alpha4]
maglev-head
# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head
# IronRuby
ironruby[-1.1.3]
ironruby-head
安装
rvm install 版本号
2.pod第三方库
打开终端进入到工程文件下
使用pod init
初始化一个Podfile 文件
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'DropView' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for DropView
end
我们需要在 do 和end之间添加我们需要pod的第三方库
使用pod查找
pod search 'dsBridge'
在终端出现查询的结果
将这行命令添加到Podfile文件中
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'PodTest' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for DropView
pod 'dsBridge', '~> 3.0.5'
end
保存在终端执行 pod install
等自动下载完成即可
可能会出现Failed to connect to 127.0.0.1 port.....
的错误
第一步
查询是否使用了代理:
git config --global http.proxy
第二步
取消代理
git config --global --unset http.proxy