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/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章