cocoapods 安装使用

来源:互联网 发布:酷家乐云设计软件 编辑:程序博客网 时间:2024/06/05 10:44

一、安装ruby镜像文件

参考网址:https://ruby.taobao.org/

步骤一:替换安装镜像路径

gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/

辅助命令行: 查询

$ gem sources -l*** CURRENT SOURCES ***https://ruby.taobao.org# 请确保只有 ruby.taobao.org


步骤二:安装镜像

gem install rails -V



二、安装cocoapods

参考网址:http://www.tuicool.com/articles/7VvuAr3

步骤一:安装pod

$sudo gem install -n /usr/local/bin cocoapods


辅助命令行: $ pod  显示pod  所有命令

1、$pod setup      更新gem  【第三方库更新】 RubyGems system software updated    如果没有报错、说明安装成功

2、$ pod update 更新pod

3、$ pod search MJRefresh   查询指定第三方库

控制器打印:【可以查询到本地第三方库  版本状态】

adsl-172-10-2-210:123456 rachel$ pod search MJRefresh

-> MJRefresh (3.1.0)

   An easy way to use pull-to-refresh

   pod 'MJRefresh', '~> 3.1.0'  

   - Homepage: https://github.com/CoderMJLee/MJRefresh

   - Source:   https://github.com/CoderMJLee/MJRefresh.git

   - Versions: 3.1.0, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1,

   3.0.0, 2.5.0, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5,

   2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.2, 2.3.1, 2.3.0, 2.2.1, 2.2.0, 2.1.0,

   2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.4.7, 1.4.6, 1.4.5, 1.4.4, 1.4.3, 1.4.1,

   1.4.0, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0,

   1.1.0, 1.0.5, 1.0.4, 1.0.3, 0.0.1 [master repo]



三、使用

步骤一: cd /Users/rachel/Desktop/123456  CD到指定的工程目录下 【直接拖工程进控制器即可找到目录】

步骤二:在工程里面新建一个文档 【使用sublime text或者使用终端vim编辑器】、并且把search到的第三方版本添加到文档内、保存关闭

步骤三: 确定终端cd到项目总目录,然后输入 pod install



0 0
原创粉丝点击