美文网首页
Apple M1安装cocopods报错相关

Apple M1安装cocopods报错相关

作者: 朝辉 | 来源:发表于2023-03-31 12:40 被阅读0次
    报错信息
    ERROR:  While executing gem ... (Gem::Exception)
        OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
    
    一、安装openSSL

    1、执行以下命令安装

    brew install openssl@1.1
    

    2、设置openSSL环境变量

    echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc
    export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
    export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
    source ~/.zshrc
    

    3、查看openSSL安装路径

    which openssl
    // 路径
    /opt/homebrew/opt/openssl@1.1/bin/openssl
    
    二、重新安装ruby

    执行以下命令安装

    rvm reinstall 3.1.2 --with-openssl-dir='openssl安装路径'
    sudo gem install -n /usr/local/bin cocoapods
    

    相关文章

      网友评论

          本文标题:Apple M1安装cocopods报错相关

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