安装依赖项
sudo yum install -y perl zlib-devel openssl-devel
安装git
sudo yum install -y git
git config --global http.sslVerify false
curl取消ssl认证
echo "insecure" >> ~/.curlrc
安装rbenv
https://github.com/rbenv/rbenv
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
重启bash后继续执行:文章来源:https://www.toymoban.com/news/detail-732068.html
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
rbenv install RUBY_VERSION
rbenv global RUBY_VERSION
验证是否安装成功
ruby -v
gem -v
bundler -v
Ruby安装位置:~/.rbenv/versions/RUBY_VERSION/
文章来源地址https://www.toymoban.com/news/detail-732068.html
到了这里,关于CentOS安装Ruby环境的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!