Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 安装 Ruby 2.3.0 #33

Open
johnnian opened this issue Sep 7, 2017 · 0 comments

Comments

1 participant
@johnnian
Copy link
Owner

commented Sep 7, 2017

Ruby 安装方法——RVM

操作系统: CentOS 6.5

说明:在CentOS上,直接用 yum 安装 Ruby的话,安装的版本比较低,所以,就直接用 RVM 进行安装。

步骤1: 安装依赖包

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

步骤2: 安装 RVM

# curl -sSL https://rvm.io/mpapis.asc | gpg --import -
# curl -L get.rvm.io | bash -s stable
# source /etc/profile.d/rvm.sh
# rvm reload

步骤3: 验证环境依赖

# rvm requirements run

Checking requirements for centos.
Requirements installation successful.

步骤4: 安装 Ruby

直接从原始的 Ruby源下载,速度很慢,所以,需要切换成淘宝的镜像源:

# echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > $rvm_path/config/db

执行安装:

# rvm requirements
# rvm install 2.3.0
# rvm use 2.3.0 --default --create

验证是否安装成功, 切换 gem源

# ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

# gem -v
2.5.1

# gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

https://gems.ruby-china.org/ added to sources
https://rubygems.org/ removed from sources

@johnnian johnnian added this to Linux工具 in 开发工具 Sep 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.