CentOS 6.3下編譯安裝Ruby 2.0筆記
LINUX操作系統(tǒng): CentOS6.3 64bit
Ruby: ruby-2.0.0-p247
一.安裝開發(fā)包(使用默認(rèn)CENTOS更新源)
# yum install openssl* openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel
二.關(guān)閉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
編譯時報(bào)錯
ossl_pkey_ec.c:815: error: ‘EC_GROUP_new_curve_GF2m' undeclared (first use in this function)
google后找到官方的一個解決補(bǔ)丁,也就是替換兩個ssl庫文件,以下為該補(bǔ)丁文件打包下載地址
本地下載
詳見: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命令集加入系統(tǒng)環(huán)境變量
# 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~
- Ruby學(xué)習(xí)筆記之gem 命令詳解
- Ruby rails 頁面跳轉(zhuǎn)(render和redirect_to)
- Ruby 字符串處理
- RUBY 新手教程 跟我一起學(xué)ruby
- 學(xué)習(xí)Ruby你需要了解的相關(guān)知識(rvm, gem, bundle, rake, rails等)
- Ruby中執(zhí)行Linux shell命令的六種方法詳解
- 淘寶網(wǎng)提供的國內(nèi)RubyGems鏡像簡介和使用方法
- 二十分鐘 教你Ruby快速入門 圖文教程
- 詳解Ruby中正則表達(dá)式對字符串的匹配和替換操作
- Ruby Gems更換淘寶源方法
- Windows下Ruby on Rails開發(fā)環(huán)境安裝配置圖文教程
- ruby 學(xué)習(xí)筆記(2) 類的基本使用
- ruby 異常處理:rescue
- Ruby中的return、break、next詳解
- 舉例講解Ruby中require的使用方法
- 更改RubyGem安裝源
- 使用Ruby來處理JSON的簡單教程
- Ruby信號處理詳解
相關(guān)文章
Ruby的面向?qū)ο蠓绞骄幊虒W(xué)習(xí)雜記
Ruby是具有面向?qū)ο筇匦缘木幊陶Z言,這里整理了一些Ruby的面向?qū)ο蠓绞骄幊虒W(xué)習(xí)雜記,包括類與方法等基本的面向?qū)ο笠氐闹R,需要的朋友可以參考下2016-05-05設(shè)計(jì)模式中的模板方法模式在Ruby中的應(yīng)用實(shí)例兩則
這篇文章主要介紹了設(shè)計(jì)模式中的模板方法模式在Ruby中的應(yīng)用實(shí)例兩則,經(jīng)典的項(xiàng)目經(jīng)理例子在這里又被套上用了^^需要的朋友可以參考下2016-03-03windows下安裝ruby與rails時遇到的問題總結(jié)
這篇文章主要總結(jié)了windows下安裝ruby與rails時遇到的問題,本文總結(jié)的問題都是通過自己實(shí)踐所得來的,總結(jié)的還算是相對比較全面,需要的朋友可以參考學(xué)習(xí),下面來一起看看吧。2017-04-04Ruby升級后no such file to load -- readline解決辦法
這篇文章主要介紹了Ruby升級后no such file to load -- readline解決辦法,需要的朋友可以參考下2015-04-04Ruby實(shí)現(xiàn)批量對文件增加前綴代碼分享
這篇文章主要介紹了Ruby實(shí)現(xiàn)批量對文件增加前綴代碼分享,本文給出實(shí)現(xiàn)代碼、使用方法、使用示例等內(nèi)容,需要的朋友可以參考下2015-01-01學(xué)習(xí)Ruby你需要了解的相關(guān)知識(rvm, gem, bundle, rake, rails等)
這篇文章主要介紹了學(xué)習(xí)Ruby你需要了解的相關(guān)知識(rvm, gem, bundle, rake, rails等),需要的朋友可以參考下2014-06-06