问题1:

   执行命令:./redis-trib.rb 

/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- redis (LoadError)from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'from ./redis-trib.rb:25:in `<main>'

解决方法:下载安装rubygem 进入解压包中.configure    make && make install 


     此时就可以运行gem intall redis 命令,来安装ruby执行redis的相关依赖。


问题2:

gem install redis 命令出现的问题

ERROR:  Loading command: install (LoadError)cannot load such file -- opensslERROR:  While executing gem ... (NoMethodError)    undefined method `invoke_with_build_args' for nil:NilClass

手动安装opensll,此问题解决。



问题3:

接着执行命令:gem install redis

ERROR:  Loading command: install (LoadError)cannot load such file -- zlib

手动安装zlib包解决(这个可能是系统太纯净,没有些包的问题)。安装过程不多说,手动下载安装包安装



问题4:

接着执行命令:gem install redis




 
  
  1. ERROR:  While executing gem ... (Gem::Exception)

  2.     Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources


  3. 网上搜索到的解决方法: gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/

  4. ERROR:  While executing gem ... (Gem::Exception)

  5.     Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

  6. 还是问题以旧。

解决方法:


      gem sources -a https://gems.ruby-china.org/ 把https地址改成 gem sources -a  http://gems.ruby-china.org/

执行成功,查看gem source -l 镜像地址修改成功。