CentOS安装Ruby环境

安装依赖项

bash 复制代码
sudo yum install -y perl zlib-devel openssl-devel

安装git

bash 复制代码
sudo yum install -y git
git config --global http.sslVerify false

curl取消ssl认证

bash 复制代码
echo "insecure" >> ~/.curlrc

安装rbenv

https://github.com/rbenv/rbenv

bash 复制代码
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc

重启bash后继续执行:

bash 复制代码
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
rbenv install RUBY_VERSION
rbenv global RUBY_VERSION

验证是否安装成功

bash 复制代码
ruby -v
gem -v
bundler -v

Ruby安装位置:~/.rbenv/versions/RUBY_VERSION/

相关推荐
爱吃香菜的初学者1 小时前
十四.Linux——消息队列
linux·运维·开发语言
Apipi*8 小时前
30天速通Linux 第六章信号及信号处理
linux·运维·信号处理
天启HTTP9 小时前
爬虫防封核心原理:IP轮换机制与风控规避逻辑
linux·服务器·网络·爬虫·tcp/ip
广州浮点FLOATLIC12 小时前
许可证服务器迁移后软件打不开:研发 IT 怎样定位连接问题
linux·服务器·数据库
BLUcoding12 小时前
接口服务公网超时排查记录:SecureRandom 阻塞问题分析与解决
java·linux·springboot·aes·securerandom
AIgorithmGEEK12 小时前
[Linux]从手写报头到内核套路:序列化、反序列化与自定义协议全链路
linux·运维·服务器·网络·序列化·反序列化
Nil20812 小时前
leetcode 139单词拆分
linux·运维·服务器
Starry-sky(jing)12 小时前
BUG: unable to handle kernel paging request 完整排查:dmesg 四要素与三路定罪
linux·运维·服务器·内核·排障
mounter62512 小时前
从硬件互连到操作系统变革:CXL 技术演进与 Linux 内核工程挑战
linux·运维·服务器
xh didida14 小时前
Linux -- 基础IO
linux·服务器·开发语言·c++