gem install redis报错解决办法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gem install redis报错解决办法相关的知识,希望对你有一定的参考价值。
参考技术A redis-cluster安装需要通过gem install redis来安装相关依赖。否则报错。通过gem install redis执行后会出现两个问题:
1、缺少zlib依赖
问题:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method 'invoke_with_build_args' for nil:NilClass
解决:
通过yum install zlib-devel 安装zlib库
然后集成zlib库到ruby环境
cd /usr/local/ruby-2.2.7/ext/zlib
ruby extconf.rb
重要:ext/openssl/Makefile 增加 top_srcdir = ../..
//这一步如果不修改,make时会爆出另外一个错误
//make:*** No rule to make target '/include/ruby.h', needed by 'zlib.o'. Stop
make && make install
2、缺少openssl库
问题:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
解决:
通过yum install openssl-devel 安装openssl库
然后集成到ruby环境
cd /usr/local/ruby-2.2.7/ext/zlib
ruby extconf.rb
重要:ext/openssl/Makefile 增加 top_srcdir = ../..
//修改Makefile中的$(top_srcdir)为../..
make && make install
再次运行gem install redis,出现下图则表示安装成功
关于ruby安装在windows gem install redis-dump 报错:MSYS2 could not be found
https://rubyinstaller.org/downloads/ ruby windows安装地址 安装带devkit的这样就自带MSYS2 不然报错
success 不再报错
以上是关于gem install redis报错解决办法的主要内容,如果未能解决你的问题,请参考以下文章
解决方法:配置群集时# gem install redis 报错:Unable to require openssl, install OpenSSL and rebuild ruby
关于ruby安装在windows gem install redis-dump 报错:MSYS2 could not be found