Linux operating system: CentOS6.3 64bit
ruby:ruby-2.0.0-p247
I. Installing the development pack (using the default CentOS update source):
The code is as follows |
Copy Code |
# yum Install openssl* openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-de Vel
|
Two. Close Iptables and SELinux
The code is as follows |
Copy Code |
# Service Iptables Stop # Setenforce 0 # Vi/etc/sysconfig/selinux --------------- Selinux=disabled
|
---------------
Three. Install Ruby
The code is as follows |
Copy Code |
# wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz # tar ZXVF ruby-2.0.0-p247 # CD ruby-2.0.0-p247 #./configure--enable-shared--enable-pthread--prefix=/usr/local/ruby # Make && make install
|
Compile times wrong
———————————————————————————
Ossl_pkey_ec.c:815:error: ' ec_group_new_curve_gf2m ' undeclared (in the This function)
————————————————————————————
Google found an official solution to the patch, that is, replace two SSL library files, the attachment for the patch file package download address
See: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808
Workaround:
The code is as follows |
Copy Code |
# CD ruby-2.0.0-p247 # wget HTTPS://BUGS.RUBY-LANG.ORG/PROJECTS/RUBY-TRUNK/REPOSITORY/REVISIONS/41808/RAW/EXT/OPENSSL/OSSL_PKEY_EC.C # wget 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/
|
Recompile:
The code is as follows |
Copy Code |
# Make && make install
|
Four. Add Ruby command set to System environment variable
The code is as follows |
Copy Code |
# echo "path= $PATH:/usr/local/ruby/bin;export PATH" >>/etc/profile # Source/etc/profile
|
Five. Check Ruby version
The code is as follows |
Copy Code |
# ruby-v —————————————————————————— Ruby 2.0.0p247 (2013-06-27 revision 41674) [X86_64-linux] —————————————————————————— # Gem--version —————————————————————————— 2.0.3 www.111cn.net —————————————————————————— # IRB —————————————————————————— IRB (main):001:0> 3+5 => 8 IRB (main):002:0> puts "Hello world!" Hello world!
|
——————————————————————————
Success O (∩_∩) o~