CentOS6.3下编译安装Ruby2.0-创新互联

LINUX操作系统: CentOS6.3 64bit

目前成都创新互联公司已为1000多家的企业提供了网站建设、域名、网络空间、成都网站托管、企业网站设计、丰都网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

Ruby: ruby-2.0.0-p247

一.安装开发包(使用默认CENTOS更新源):

# yum install openssl* openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel

二.关闭iptables和SELINUX

# service iptables stop

# setenforce 0

# vi /etc/sysconfig/selinux

---------------

SELINUX=disabled

---------------

三.安装Ruby

# wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz

# tar zxvf ruby-2.0.0-p247.tar.gz

# cd ruby-2.0.0-p247

# ./configure --enable-shared --enable-pthread --prefix=/usr/local/ruby

# make && make install

编译时报错

———————————————————————————

ossl_pkey_ec.c:815: error: ‘EC_GROUP_new_curve_GF2m’ undeclared (first use in this function)

————————————————————————————

google后找到官方的一个解决补丁,也就是替换两个ssl库文件,附件为该补丁文件打包下载地址

详见:https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808

解决方法:

# cd ruby-2.0.0-p247

# wget --no-check-certificate https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/raw/ext/openssl/ossl_pkey_ec.c

# wget --no-check-certificate https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/raw/test/openssl/test_pkey_ec.rb

# mv ext/openssl/ossl_pkey_ec.c  ext/openssl/ossl_pkey_ec.c.bak

# cp ossl_pkey_ec.c ext/openssl/

# mv test/openssl/test_pkey_ec.rb test/openssl/test_pkey_ec.rb.bak

# cp test_pkey_ec.rb  test/openssl/

重新编译:

# make && make install

四.将ruby命令集加入系统环境变量

# echo "PATH=$PATH:/usr/local/ruby/bin;export PATH" >> /etc/profile

# source /etc/profile

五.检查ruby版本

# ruby -v

——————————————————————————

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

——————————————————————————

# gem --version

——————————————————————————

2.0.3

——————————————————————————

# irb

——————————————————————————

irb(main):001:0> 3+5

=> 8

irb(main):002:0> puts "hello world!"

hello world!

——————————————————————————

大功告成 O(∩_∩)O~

附件:http://down.51cto.com/data/2364283

创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。


网页标题:CentOS6.3下编译安装Ruby2.0-创新互联
转载源于:http://lszwz.com/article/ddscjj.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款