# Install Development Tools
yum groupinstall -y "Development Tools"
# Install OpenSSL Devel
yum install -y openssl-devel
# Download Ruby 2.6.2
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.gz
# Unzip
tar -xvf ruby-2.6.2.tar.gz
# Copy to /usr/local/src
mv ruby-2.6.2 /usr/local/src/
cd /usr/local/src/ruby-2.6.2
# Compiler and Install
./configure
make
make install
# Update and Install Bundler
chmod 755 ruby
gem update --system
gem install bundler
# Fix OpenSSL issue
cd ext/openssl/
make top_srcdir="../../"
make install top_srcdir="../../"
參考資料:
http://ask.xmodulo.com/upgrade-ruby-centos.html