ruby 编译安装,gem国内源ruby.taobao.org
centos6.6final
一.安装依赖包(使用默认CENTOS更新源):
# yum install openssl* openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel
二.关闭iptables和SELINUX
# service iptables stop
# setenforce 0
# vi /etc/sysconfig/selinux
---------------
SELINUX=disabled
---------------
三.安装Ruby
国内用淘宝的源快:https://ruby.taobao.org/
#wget https://ruby.taobao.org/mirrors/ruby/ruby-2.2.0.tar.gz 或者官方下载源码包 https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.2.0.tar.gz
#tar zxvf ruby-2.3.0.tar.gz
#cd ruby-2.3.0
#./configure --prefix=/opt /ruby
#make
#make install
#ln -s /opt/ruby/bin/* /usr/bin/ 【如安装在/usr/local下,无需要做软链接 和环境变量添加】
(将ruby命令集加入系统环境变量
# echo "PATH=$PATH:/opt/ruby/bin;export PATH" >> /etc/profile
# source /etc/profile
)
#
#gem sources --remove https://rubygems.org/
#gem sources -a https://ruby.taobao.org/
#gem sources -l
#gem update --system
==========================================================================
ruby gem国内源ruby.taobao.org
===========================================================================
# 删除默认的官方源
gem sources -r https://rubygems.org/
# 添加淘宝源
gem sources -a https://ruby.taobao.org/
# 查看当前源
gem sources -l # https://ruby.taobao.org
============================================================================