首页 > 代码库 > radhat/centos 下编译安装ruby

radhat/centos 下编译安装ruby

#安装编译环境

yum groupinstall "Development tools"

或者

yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel


#删除已经安装的项目:

yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs


#安装依赖:

yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel


#下载Ruby源码并解压缩:

tar zxvf ruby-1.9.3.pXXX.tar.gz


#编译安装:

cd ruby-1.9.3.pXXX

./configure

make && make install


#检查安装:

ruby -v

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


radhat/centos 下编译安装ruby