情况大体是这样的,接手了别人在配的一台服务器,Red Hat Enterprise Linux Server release 5.5。
至于他的ruby gem之类的安装包是怎么安装的我一概不知,问他他就说按照步骤来的,但是各种问题层出不穷。
首先是环境变量的问题,这个好解决,一步搞定了。
之后是gem包的安装问题,只要运行 gem install * 命令,都会出现下面这个错误:
ERROR: Loading command: install (LoadError)
no such file to load — zlib
ERROR: While executing gem … (NameError)
uninitialized constant Gem::Commands::InstallCommand
这个错误,在google上搜索,答案真的是一片一片的,但是所有的答案无非都是下面这几句话,千篇一律整齐划一,好不无奈
引用
install the zlib dev libraries
sudo apt-get install zlib1g-dev
Then go to the source directory from where you compiled the Ruby and there you will find source for zlib.
e.g. /usr/local/src/ruby-1.8.7/ext/zlib
In case, if you used RVM, then it will be here
cd /home/user/.rvm/src/ruby-1.8.7-p352/ext/zlib
And do the following commands
ruby extconf.rb
make
make install
上面这个答案明显是针对ubuntu的,我这台服务器既不能联外网,又不是ubuntu,所以完全不能效颦
我去搜索zlib包,几乎完全被ubuntu的deb文件刷屏,最后还好找到了(见附件)
configure & make & make install
很顺利,很成功
但是仍然有错误,我把gem重新安装还是没用的,于是怀疑是ruby在编译安装的时候没有编译这个zlib。
干脆把ruby重新编译安装,问题搞定,看来就是上面我猜测的这个原因。
之后我觉得,上面引文中的
/home/user/.rvm/src/ruby-1.8.7-p352/ext/zlib 目录下 去扩展一下也应该是可以的
ruby extconf.rb
make
make install
只是我这边ruby重新编译之后问题成功了,也没有必要去复现这个问题了
====================================================================
http://netfork.iteye.com/blog/432928
passenger编译安装nginx的时候出错:
checking for openssl/ssl.h... no
一、安装openssl扩展
编译安装
tar -zxvf openssl-0.9.8k.tar.gz
cd openssl-0.9.8k
./configure
make && make install
二、然后到源码
文件夹的/ext/openssl文件夹
cd ruby-1.8.7-p330/ext/openssl
ruby extconf.rb --with-openssl-include=/usr/local/ssl/include/ --with-openssl-lib=/usr/local/ssl/lib
make && make install
如果遇到
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_meth.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
服务器是64位的,
./config shared -fPIC
按照上面命令重新编译openssl
再重新安装ruby的ext扩展
make distclean
ruby extconf.rb --with-openssl-include=/usr/local/ssl/include/ --with-openssl-lib=/usr/local/ssl/lib
make && make install
================================
passenger-install-nginx-moudle 出现如下错误
StaticContentHandler.c:69: error: ‘ngx_http_request_t’ has no member named ‘zero_in_uri’
注释掉gem包中的
Delete these line from ${GEM_HOME}/passenger-2.2.15/ext/nginx/StaticContentHandler.c
if (r->zero_in_uri) {
return NGX_DECLINED;
}
参见
https://github.com/hmsk/nginx-passenger-centos
===============================
nginx启动出现错误
nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
进入/lib64目录中手动链接下(服务器是64位的)
ln -s libpcre.so.0.0.1 libpcre.so.1
分享到:
相关推荐
安装方式在附件中,复制即可安装,基于RedHat 6.5 默认安装版本
liunx下oracle官方安装文档,包括suse,redhat等等系统,内容详细。
解决redhat 8.2 yum报错 This system is not registered to Red Hat Subscription Management 解决redhat8安装centos8的rpm出错的问题
redhat linux 安装db_load 模块
KunLun9016安装Redhat报错故障案例分析
redhat中文语言包,用于更改桌面操作语言,默认安装为英文安装此文件可以把操作界面改为中文
Redhat 6 2 zlib库文件 共有需求的人使用
完美的解决redhat7安装DB2报错The 32 bit library file libstdc++.so.5 is not found on the system.的问题。
Red_Hat_Enterprise_Linux_安装vmware-tools ,安装后,在windows下的linux虚拟机中安装好后,鼠标可以在win与linux虚拟机中切换,也可以直接往linux虚拟机中复制文件
redhat9 支持下的samba-common-2.2.7a-7.9.0.i386 从安装包内提取制作的镜像文件 samba-2.2.7a-7.9.0.i386、 samba-client-2.2.7a-7.9.0.i386、 samba-common-2.2.7a-7.9.0.i386三部分
sshd: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory 解决方法,做软链接: #cd /usr/lib64/ #ln -s libcrypto.so.1.0.0 libcrypto.so.10 #...
我用的是ubuntu18.04安装nginx 一般来说我们安装的nginx文件结构大致是这样的: 1. 所有的配置文件都在/etc/nginx下,并且每个虚拟主机已经安排在了/etc/nginx/sites-available下 2. 程序文件在/usr/sbin/nginx 3...
redhat安装简明教程,很详尽的安装步骤,对你会有帮助的
redhat5下 安装asm数据库所需要的包(1)
Redhat6.6/Redhat6.7 docker 离线安装依赖包
redhat6.3 mongodb openssl
RedHat图形安装Oracle10g必需包 全部包在root用户下rpm -ivh *.rpm安装即可。
hadoop2.4.1的64位redhat的native包,用java7编译的
linux(RedHat)抓包及ethereal抓包工具的使用方法借鉴.pdf
RedHat安装WebLogic11g软件及Web工程的部署 介绍Linux RedHat下安装weblogic11g的详细步骤