LINUX操作系统:CentOS6.3 64位
Ruby: ruby-2.0.0-p247
一。安装开发包(使用默认CENTOS更新源):
# yum安装openssl * openssl-devel zlib-devel gcc gcc-c + +使autoconf readline-devel curl-devel expat-devel gettext-devel
二。关闭iptables和SELINUX
#服务iptables停止
# setenforce 0
# vi/etc/sysconfig/selinux
- - - - - - - - - - - - - - - - - -
禁用SELINUX=
- - - - - - - - - - - - - - - - - -
三。安装Ruby # wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
#焦油zxvf ruby-2.0.0-p247.tar。广州
# cd ruby-2.0.0-p247
# ./configure——启用共享enable-pthread——prefix=/usr/地方/ruby
#做,,使安装
详见: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。贝克
# cp ossl_pkey_ec。c ext/openssl/
#测试/openssl/test_pkey_ec mv。rb试验/openssl/test_pkey_ec.rb。贝克
# cp test_pkey_ec。rb,测试/openssl/
重新编译:
#做,,使安装
四。将ruby命令集加入系统环境变量
#回声”路径=$路径:/usr/地方/ruby/bin;出口路径”在祝辞/etc/profile
#源/etc/profile
五。检查ruby版本
# ruby - v
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
ruby 2.0.0p247 41674(2013-06-27修订)(x86_64-linux)
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
#宝石——版本
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.0.3
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
# irb
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
irb(主要):001:0>3 + 5
=比;8
irb(主要):002:0>将“hello world !”
hello world !
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
大功告成O (∩_∩) O ~