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
    
  • 相关阅读:
    冒泡排序
    Windows 10家庭版升级专业版
    VRRP + MSTP实验
    MSTP多生成树协议
    解决office 2016提示“你的许可证不是正版,并且你可能是盗版软件的受害者。使用正版Office,避免干扰并保护你的文件安全”
    路由器开启ssh实现远程管理
    CentOS 7安装Telnet服务进行远程管理
    CentOS 7开启ssh服务进行远程管理
    华为特有接口Hybrid
    Vlan Mapping
  • 原文地址:https://www.cnblogs.com/dianel/p/10558161.html
Copyright © 2011-2022 走看看