1、安装
- 通过使用rvm来管理ruby
# yum install ruby-devel
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
# curl -sSL https://rvm.io/mpapis.asc | gpg --import -
# curl -L get.rvm.io | bash -s stable
# source /etc/profile.d/rvm.sh # 有时此服务挂掉了,则默认的ruby就会变
# rvm reload
# rvm requirements run
# rvm install 2.4.0
# rvm list
# rvm use 2.4.0 --default
# ruby --version
2、ruby安装常用库示例
# gem install 'oj'
# gem install 'typhoeus'
# gem install 'recog'
# gem install 'nori'
# gem install 'activesupport'
# gem install 'rspec'
# gem install 'rchardet'
# gem install 'rubyzip'
# gem install 'ip2location_ruby'