美文网首页
cocoaPods和Homebrew安装

cocoaPods和Homebrew安装

作者: symBoy | 来源:发表于2021-08-28 20:52 被阅读0次

    周五的时候公司给买了一台M1芯片的电脑,在公司下载Xcode一天没有下载成功,今天周六在家配置一下开发环境记录一下步骤和遇到的坑。

    安装Homebrew步骤:

    1.执行命令:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"                            

    然后就遇到了问题,问题如下:

     Failed to connect to raw.githubusercontent.com port 443: Connection refused

    1.我解决的方案是进入https://githubusercontent.com.ipaddress.com网站搜索raw.githubusercontent.com找到图1的位置

    图1

    2.command+shift+G 进入图2的文件夹

    图2

    3.编辑图2的hosts在最后面添加   185.199.108.133    raw.githubusercontent.com

    图3

    然后在执行/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"  安装Homebrew又报错了

    错误信息:curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443 

    解决办法使用国内源:

    执行: /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

    重启终端,至此Homebrew安装成功就可以使用了

    二、Command Line Tools for Xcode安装

    执行 xcode-select --install

    三、使用Homebrew安装Rudy和cocoaPods

    1.brew install ruby(安装最新版的ruby)

    2.ruby --version (查看安装版本)

    3.sudo gem update --system(gem更新)

    4.gem sources --remove https://rubygems.org/(移除之前的源)

    5.gem sources --add https://gems.ruby-china.com/(设置新的源)

    6.gem sources -l(查看当前源)

    7.gem --version(gem版本)

    8.sudo gem install -n /usr/local/bin cocoapods(安装cocoapods)

    9.pod setup(安装本地库)

    10.pod repo update(更新本地库)

    11.pod --version(pod版本)

    相关文章

      网友评论

          本文标题:cocoaPods和Homebrew安装

          本文链接:https://www.haomeiwen.com/subject/spfiiltx.html