centos 安装ruby 2.x.x 并添加openssl 和 zlib扩展

2018-01-13 10:55:48来源:oschina作者:莫铭人点击

分享

首先到ruby官网下载需要的版本(如2.4.3):


http://www.ruby-lang.org/en/downloads/


解压到 /usr/local/ruby目录,


然后切换到/usr/local/ruby/ruby-2.4.3目录,


./configure
make && make install

验证:


ruby -v

添加openssl扩展:


首先切换到/usr/local/ruby/ruby-2.4.3/ext/openssl目录:


cd /usr/local/ruby/ruby-2.4.3/ext/openssl
ruby extconf.rb --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib
ln -s /usr/local/ruby/ruby-2.4.3/include /
make && make install

添加zlib扩展:


/usr/local/ruby/ruby-2.4.3/ext/zlib目录:


cd /usr/local/ruby/ruby-2.4.3/ext/zlib
ruby extconf.rb
make && make install

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台