Cent OS 安装 Ruby

1. 安装更新依赖包

yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel perl

2. 安装RVM

\curl -sSL https://get.rvm.io | bash -s stable

3. 添加rvm环境变量

source /etc/profile.d/rvm.sh

4. 安装openssl

rvm pkg install openssl 


如果出现RPM-GPG-KEY-EPEL-6: import read failed(2)

epel-release-6-8.noarch.rpm failed: no such file or directory

增加yum源

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm


5. 安装ruby

rvm install ruby

默认安装最新版,目前是2.0.0-p247

把gem镜像换到淘宝

$ gem sources --remove https://rubygems.org/

1. 设置源

$ gem sources --remove https://rubygems.org/

$ gem sources -a http://ruby.taobao.org/

$ gem sources -l


6. 安装Net SSH Gem(可用于登陆服务器以及上传文件)

gem install net-ssh

gem install net-scp

$ gem sources -a http://ruby.taobao.org/


你可能感兴趣的:(centos,安装,Ruby)