当前位置:网站首页>cocoapods的安装和使用
cocoapods的安装和使用
2022-07-26 09:22:00 【~轻舟~】
今天在安装cocoapods的时候出现的情况:
首先安装cocoapods执行命令行:sudo gem install cocoapods
会出现这个错误:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - connect(2) (https://rubygems.org/quick/Marshal.4.8/cocoapods-0.37.1.gemspec.rz)
ERROR: Possible alternatives: cocoapods这是因为service被墙了,要换一个sources:
gem sources --remove https://rubygems.org/
gem sources -a http://ruby.taobao.org/
gem sources -l如果打印出来的东西是:
http://ruby.taobao.org那么再执行安装cocoapods命令:
sudo gem install cocoapods然后你就会看到安装进程了,那么接下来就恭喜你完成了!!!
接下来新建一个项目QZProject
$ cd xxxxxxxxxxxx为项目目录,直接将项目拖到终端就行
新建Podfile文件
$ vim Podfile输入i进入编辑状态,目前高版本Podfie这样编写
$ platform: ios,'8.0'
$ target 'QZProject' do
$ pod 'SDAutoLayout'
$ end完成后敲esc然后:wq(保存并退出)
最后
$ pod install完成
当遇到一下问题时: 
可以这样解决:
在Podfile文件中加上:
use_frameworks!即可!!!
持续更新
边栏推荐
- Selection and practice of distributed tracking system
- tornado之多进程服务
- 分布式跟踪系统选型与实践
- Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
- 【Mysql】一条SQL语句是怎么执行的(二)
- 原根与NTT 五千字详解
- Windows通过命令备份数据库到本地
- PHP 之 Apple生成和验证令牌
- Clean the label folder
- NTT (fast number theory transformation) polynomial inverse 1500 word analysis
猜你喜欢
随机推荐
Order based evaluation index (especially for recommendation system and multi label learning)
Clean the label folder
大二上第一周学习笔记
【线上问题】Timeout waiting for connection from pool 问题排查
JS - DataTables 关于每页显示数的控制
"Could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32"
暑假末尾学习笔记
Innovus is stuck, prompting x error:
【线上死锁分析】由index_merge引发的死锁事件
Where are the laravel framework log files stored? How to use it?
760. 字符串长度
Pat grade a a1013 battle over cities
Apple generated and verified tokens for PHP
Laravel框架日志文件存放在哪里?怎么用?
什么是异步操作
Error: Cannot find module ‘umi‘ 问题处理
Byte buffer stream & character stream explanation
el-table的formatter属性的用法
Original root and NTT 5000 word explanation
839. 模拟堆








