ruby 不完全安装修复 [openssl or zlib not found]

本文提供了当遇到Ruby扩展包如openssl或zlib安装失败时的解决办法。通过进入Ruby源码对应扩展包目录并重新编译安装,可以有效解决安装过程中出现的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

发现 ruby源码包的ext文件夹下有很多 扩展包, 在源码安装不大顺利时,可以进入相应的应用目录

比如安装中出现:
一. openssl support for ruby 1.9.3 not found
1. 进入 源码里相应扩展包目录
cd ruby-1.9.3-p0/ext/openssl/


2.重新编译安装这个部件, 这样就OK啦
ruby extconf.rb
make
sudo make install


二. gem install rails -> zlib failed
1. 同样引用上面的2步, 只是操作的目录换成了/ext/zlib/.


关键词:
zlib / openssl support for ruby not found
root@user:~# git clone https://github.com/rbenv/rbenv.git ~/.rbenv Cloning into '/root/.rbenv'... remote: Enumerating objects: 3395, done. remote: Counting objects: 100% (289/289), done. remote: Compressing objects: 100% (123/123), done. remote: Total 3395 (delta 228), reused 166 (delta 166), pack-reused 3106 (from 4) Receiving objects: 100% (3395/3395), 723.62 KiB | 1.69 MiB/s, done. Resolving deltas: 100% (2086/2086), done. root@user:~# echo 'export PATH="$ HOME/.rbenv/bin:$ PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build -bash: /etc/profile.d/rvm.sh: No such file or directory -bash: /usr/local/rvm/scripts/rvm: No such file or directory Command 'rbenv' is available in the following places * /bin/rbenv * /usr/bin/rbenv The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable. rbenv: command not found Command 'git' is available in the following places * /bin/git * /usr/bin/git The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable. git: command not found root@user:~# rbenv install 3.1.0 Command 'rbenv' is available in the following places * /bin/rbenv * /usr/bin/rbenv The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable. rbenv: command not found root@user:~# rbenv global 3.1.0 Command 'rbenv' is available in the following places * /bin/rbenv * /usr/bin/rbenv The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable. rbenv: command not found root@user:~#
最新发布
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值