国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > Ruby > 正文

CentOS 6.3下編譯安裝Ruby 2.0筆記

2020-10-29 19:43:59
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

LINUX操作系統(tǒng): CentOS6.3 64bit
Ruby: ruby-2.0.0-p247

一.安裝開(kāi)發(fā)包(使用默認(rèn)CENTOS更新源)

復(fù)制代碼 代碼如下:

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

二.關(guān)閉iptables和SELINUX

復(fù)制代碼 代碼如下:

# service iptables stop
# setenforce 0
# vi /etc/sysconfig/selinux
---------------
SELINUX=disabled
---------------

三.安裝Ruby

復(fù)制代碼 代碼如下:

# 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

編譯時(shí)報(bào)錯(cuò)
復(fù)制代碼 代碼如下:

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

google后找到官方的一個(gè)解決補(bǔ)丁,也就是替換兩個(gè)ssl庫(kù)文件,以下為該補(bǔ)丁文件打包下載地址

本地下載
詳見(jiàn):https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808
解決方法:

復(fù)制代碼 代碼如下:

# 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/

重新編譯:
復(fù)制代碼 代碼如下:

# make && make install

四.將ruby命令集加入系統(tǒng)環(huán)境變量

復(fù)制代碼 代碼如下:

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

五.檢查ruby版本

復(fù)制代碼 代碼如下:

# 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~

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 自贡市| 元阳县| 秭归县| 化隆| 裕民县| 山东| 兴文县| 泰宁县| 盈江县| 凌源市| 阳东县| 彩票| 十堰市| 游戏| 湾仔区| 密云县| 靖西县| 余干县| 肥西县| 葵青区| 江西省| 牡丹江市| 珲春市| 望江县| 壤塘县| 岳池县| 景谷| 洛隆县| 都兰县| 灯塔市| 滁州市| 顺平县| 东宁县| 甘南县| 山西省| 合作市| 金溪县| 黄平县| 麦盖提县| 南乐县| 陕西省|