网站首页 > 编程文章 正文
更新 cocoapods 的时候,提示 ruby 版本低,下面是升级 ruby 的坎坷之路。
一、材料
- macOS 系统版本 10.13.6
- 系统自带 ruby 版本为 ruby 2.3.7p456
- 系统自带 openssl 版本为 LibreSSL 2.2.7
- 另外用 brew install openssl 安装的版本为 OpenSSL 1.0.2o
二、过程
1、使用 sudo gem install cocoapods 更新 cocoapods 报错,需要 ruby version >= 2.6
2、去 ruby 官网下载 ruby-2.6.0,由于 macOS 版本较低,没有下载最新的 ruby
3、安装 ruby,执行以下操作猛如虎,一切正常:
./configure --prefix=/usr/local/ruby-2.6.0
make
sudo make install
4、把 ruby 2.6.0 可执行文件导入全局变量 PATH 中,使用如下命令:
echo 'export PATH="/usr/local/ruby-2.6.0/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
至此 ruby 2.6.0 安装成功,使用以下命令查看 ruby 版本:
ruby -v
然后终端输出 ruby 版本:
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin17]
5、重新执行 sudo gem install cocoapods 又报错,ruby 没有 openssl 模块。
6、重新编译 ruby ,带上 openssl 模块。(就是这一步,浪费了我太多时间)
一开始使用下面的命令
./configure --prefix=/usr/local/ruby-2.6.0 --with-openssl=/usr/bin/openssl
make 后,提示找不到 openssl 库:
*** Following extensions are not compiled:
openssl:
Could not be configured. It will not be installed.
/Users/esdzxc/Downloads/ruby/ruby-2.5.9/ext/openssl/extconf.rb:97: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
Check ext/openssl/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
后来发现需要使用 --with-openssl-dir ,所以更改命令再战:
./configure --prefix=/usr/local/ruby-2.6.0 --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2o_1
make
sudo make install
7、重新执行 sudo gem install cocoapods ,搞定。
猜你喜欢
- 2024-10-19 基于openssl 实现https服务(基于openssl+实现https服务体系)
- 2024-10-19 Centos openssl 升级方法(centos6.9升级openssh)
- 2024-10-19 OpenSSL神器大揭秘:加密、签名、验证一步搞定!
- 2024-10-19 Openssh8.0升级(openssh8.6p1 升级)
- 2024-10-19 windows使用openssl生成公钥和私钥
- 2024-10-19 Linux服务器运维必备技能 软件包和启动项超详细整理
- 2024-10-19 「应用安全」支持github算法限制,升级git客户端为TSL1.2协议
- 2024-10-19 CentOS 7 升级 openssl(centos7.6升级openssh)
- 2024-10-19 CentOS7下rpm包方式升级openssl到安全版本1.1.1n
- 2024-10-19 源码升级openssl3.2和openssh9.5(openssh软件源)
你 发表评论:
欢迎- 05-142014年最流行前端开发框架对比评测
- 05-14七爪源码:如何使用 Next.js 构建 Shopify 店面
- 05-14Web 前端怎样入门?
- 05-14我为什么不建议你使用框架
- 05-14推荐几个好用的React UI 框架
- 05-14PDFsharp:强大的 .NET 跨平台 PDF 处理库
- 05-14一组开源免费的Web动画图标,荐给需要的设计师和程序员
- 05-14salesforce 零基础学习(二十九)Record Types简单介绍
- 最近发表
- 标签列表
-
- spire.doc (59)
- system.data.oracleclient (61)
- 按键小精灵源码提取 (66)
- pyqt5designer教程 (65)
- 联想刷bios工具 (66)
- c#源码 (64)
- graphics.h头文件 (62)
- mysqldump下载 (66)
- sqljdbc4.jar下载 (56)
- libmp3lame (60)
- maven3.3.9 (63)
- 二调符号库 (57)
- 苹果ios字体下载 (56)
- git.exe下载 (68)
- diskgenius_winpe (72)
- pythoncrc16 (57)
- solidworks宏文件下载 (59)
- qt帮助文档中文版 (73)
- satacontroller (66)
- hgcad (64)
- bootimg.exe (69)
- android-gif-drawable (62)
- axure9元件库免费下载 (57)
- libmysqlclient.so.18 (58)
- springbootdemo (64)
本文暂时没有评论,来添加一个吧(●'◡'●)