zoukankan      html  css  js  c++  java
  • gem安装redis库时报错

    报错一:

    [root@Redis-1 software]# /usr/local/ruby/bin/gem install redis-3.2.2.gem 
    ERROR: Loading command: install (LoadError)
     cannot load such file -- zlib
    ERROR: While executing gem ... (NoMethodError)
        undefined method `invoke_with_build_args' for nil:NilClass
    
    

    【解决】

    1. yum -y install zlib-devel

    2. 进入ruby源码文件夹,安装ruby自身提供的zlib包:

       cd ruby-2.4.4/ext/zlib/
       /usr/local/ruby/bin/ruby extconf.rb 
       make
       make install
      

    2.1 报错:

        make: *** No rule to make target `/include/ruby.h', needed by `zlib.o'. Stop.
    

    打开:ext/zlib/Makefile文件,找到#zlib.o: $(top_srcdir)/include/ruby.h换成zlib.o: ../../include/ruby.h

    #zlib.o: $(top_srcdir)/include/ruby.h
    zlib.o: ../../include/ruby.h
    

    报错二:

    [root@Redis-1 software]# /usr/local/ruby/bin/gem install redis-4.1.0.gem 
    ERROR: While executing gem ... (Gem::Exception)
        Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
    

    【解决】

    1. 安装openssl:yum(本环境使用)或者源码

    2. 进入ruby源码文件夹,安装ruby自身提供的openssl包:

      cd ruby-2.4.4/ext/openssl
      # 找到各个组件的路径
      /usr/local/ruby/bin/ruby extconf.rb --with-openssl-include=/usr/include/openssl/ --with-openssl-lib=/usr/lib64/openssl/
      make 
      make install
      

    2.1. make报错:

        make: *** No rule to make target `/thread_native.h', needed by `ossl.o'. Stop.
    

    打开Makefile文件:增加top_srcdir = /opt/software/ruby-2.4.4路径

    topdir = /usr/local/ruby/include/ruby-2.4.0
    top_srcdir = /opt/software/ruby-2.4.4
    hdrdir = $(topdir)
    arch_hdrdir = /usr/local/ruby/include/ruby-2.4.0/x86_64-linux
    
  • 相关阅读:
    完美正方形-深度遍历
    CGCDSSQ Codeforces 475D
    [国家集训队]happiness
    点分治学习笔记
    [POI2008]PLA-Postering
    [20200801NOIP提高组模拟T2]电话线铺设
    [20200801NOIP提高组模拟T3]老司机
    [HNOI2001]产品加工
    分层图最短路[学习笔记]
    次芝麻
  • 原文地址:https://www.cnblogs.com/dianel/p/10558161.html
Copyright © 2011-2022 走看看