使用的包
http://download.redis.io/releases/redis-4.0.11.tar.gz
https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz
https://rubygems.org/rubygems/rubygems-2.7.7.tgz
https://rubygems.org/downloads/redis-4.0.1.gem
环境部署步骤参照我之前的博客
步骤已做完:
redis编译安装完成,服务已启动
ruby编译安装完成
因为创建集群需要gem的支持
如果连外网的请款下直接执行gem install redis就可以了,但是我的是内网环境
# tar -zxf rubygems-2.7.7.tgz
# cd rubygems-2.7.7
# ruby setup.rb
报错:
/data/packages/rubygems-2.7.7/lib/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- zlib (LoadError)
解决zlib问题:
# yum install zlib zlib-devel
# cd ruby-2.5.3/
# cd ext/
# cd zlib/
# ruby extconf.rb
# make
make: *** No rule to make target `/include/ruby.h', needed by `zlib.o'. Stop.
# vi Makefile
zlib.o: $(top_srcdir)/include/ruby.h
>>
zlib.o: ../../include/ruby.h
# make && make install
# ruby setup.rb
zlib问题解决
# gem install redis-4.0.1.gem
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
解决openssl问题
# yum install openssl openssl-devel
# cd ruby-2.5.3/
# cd ext/
# cd openssl/
# ruby extconf.rb
# make
make: *** No rule to make target `/include/ruby.h', needed by `ossl.o'. Stop.
这里要修改的地方太多,直接替换
# vi Makefile
:1,1457 s #$(top_srcdir)#../..
1457是最后的行号,具体按实际做
# make && make install
参考:
https://blog.csdn.net/xiyujianxia/article/details/79773743
https://blog.csdn.net/zhengwei125/article/details/80019887