作者:我是曰照人_692 | 来源:互联网 | 2023-09-05 19:15
gem透过代理安装heroku:geminstallheroku--http-proxyhttp:10.248.174.44:8123或http:username:passw
//gem透过代理安装heroku :
gem install heroku --http-proxy http://10.248.174.44:8123 或 http://username:password@proxy.server.address:port/
//修改sources,如果无法翻墙,修改为淘宝的ruby (gem sources --remove https://rubygems.org/ 等有反应之后再敲入以下命令 gem sources -a http://ruby.taobao.org/)
sudo gem sources --add http://rubygems.org/ --http-proxy http://10.248.174.44:8123
//添加成功后显示如下:
10:~ john$ gem sources 或 gem sources -l
*** CURRENT SOURCES ***
http://rubygems.org/
//Mac OSX EI Caption,需要添加home-brew
修改代理为http代理:
export ALL_PROXY=$http_proxy:port
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
(输入brew 如果出现很多帮助的命令则安装成功)
//安装Cocoapods
sudo gem install -n /usr/local/bin cocoa pods
//配置pods (要等好久):
pod setup
//创建project 路径
mkdir /Users/john/Desktop/CocoaPods/cocoapodsUnit
//进入该路径
cd /Users/john/Desktop/CocoaPods/cocoapodsUnit
//执行如下命令,执行完成后会多一个 Podfile
pod init
//搜索第三方类库
pod search AFNetworking
//podfile 修改
vim Podfile (进入vi并编辑podfile,添加如下信息):
platform :ios, '7.0'
pod "AFNetworking", "~> 2.0"
(:wq退出&存盘)
//下载AFNetworking:
pod install --verbose --no-repo-update
或
pod update --verbose --no-repo-update