Control+c 终端停止当前运行的命令
gem sources -l //检查当前是否有ruby的网站源
*** CURRENT SOURCES ***
// 如果返回是这个的话,证明没有课下载的ruby的源, 正常返回应该是:*** CURRENT SOURCES *** https://ruby.taobao.org/
// 或者是 *** CURRENT SOURCES *** https://rubygems.org/
//因为https://rubygems.org/在墙外,因此需要删除https://rubygems.org/网址,添加 https://ruby.taobao.org/
//因此有下面的命令
$ gem sources --remove https://rubygems.org/
source https://rubygems.org/ not present in cache //删除https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/ //添加https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
$ gem sources -l //检查当前的ruby安装源
*** CURRENT SOURCES ***
https://ruby.taobao.org/
$ sudo gem install cocoapods //安装
17 gems installed //安装成功
cd 到程序的目录 //
$ ls
$ cd Documents/
$ cd CameraSwift/
touch Podfile (创建Podfile)
8、vim Podfile(编辑命令)按i(开始编辑)
输入:
platform:ios,'7.0'
pod 'XXX','~>0.1.1'
9、esc shift :wq 退出
10、pod install
<span style="font-family:FangSong;"><span style="font-size: 14px;">pod install <wbr>被墙了,请大家换成pod install --verbose --no-repo-update</wbr></span></span>
ps:VKVideoPlayer demo会出现问题,大多数是Podfile文件里的配置有问题
这是改好了的,可以参考一下
platform :ios, '5.1.1'
pod 'DTCoreText', '~> 1.6.11'
pod 'AFNetworking', '1.3.3'
pod "VKVideoPlayer", "~> 0.1.1"
pod 'CocoaLumberjack', '~> 1.7.0'
pod 'VKFoundation', '0.1.1'
pod 'CocoaHTTPServer'
target 'VKVideoPlayerTests' do
pod 'Specta', '~> 0.2.1'
pod 'Expecta', '~> 0.3.0'
pod 'OCMock', '~> 2.2.1'
pod "VKVideoPlayer", "~> 0.1.1"
pod 'CocoaHTTPServer'
end
# Remove 64-bit build architecture from Pods targets
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
end
end
end
vim 命令集
i 插入
:wq 保存并退出
ZZ 保存并退出
:q! 强制退出并忽略所有更改
:e! 放弃所有修改,并打开原来文件。