一、环境准备
- Centos7(离线环境下)
- redis安装包redis-5.0.4.tar.gz 下载地址:https://redis.io/download
- ruby安装包ruby-2.5.5.tar.gz 下载地址:http://www.ruby-lang.org/en/downloads/
- zlib安装包zlib-1.2.11.tar.gz 下载地址:http://www.zlib.net
- rubygems安装包rubygems-3.0.3.tgz 下载地址: https://rubygems.org/pages/download
- oppenssl安装包openssl-1.0.2n.tar.gz 下载地址:https://oomake.com/download/openssl
- redis依赖库redis-4.1.0.gem 下载地址:https://rubygems.org/gems/redis/
将以上安装包都放到CentOS7系统中(基于xshell xftp上传),可以自定义路径和文件夹,此处我将安装包都放在/root/public下面
二、环境安装
1、redis安装需要依托gcc环境,先检查gcc是否安装,通过版本号查看,如果已经安装gcc会出现如下提示。
[root@localhost ~]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
2、安装ruby。进入public文件夹,解压ruby安装文件。
[root@localhost public]# tar -zxvf ruby-2.5.5.tar.gz
3、进入解压后的ruby文件夹,将ruby安装到指定目录/usr/local/ruby,编译安装
[root@localhost ruby-2.5.5]# ./configure --prefix=/usr/local/ruby ##是将ruby安装到指定目录,也可以自定义