deepin使用rvm安装ruby出现make: *** [build-ext] Error 2错误

来源:互联网 发布:js获取中间节点 编辑:程序博客网 时间:2024/05/29 02:20

ruby是很怪的东西,我之前也成功安装了几次,重新安装的deepin又无法安装,出现错误了,百撕不得骑姐!!啊啊啊!!

root@kelly-pc:~# rvm install 2.1.4Searching for binary rubies, this might take some time.No binary rubies available for: debian/8/x86_64/ruby-2.1.4.Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.Checking requirements for debian.Requirements installation successful.Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.1.4, this may take a while depending on your cpu(s)...ruby-2.1.4 - #downloading ruby-2.1.4, this may take a while depending on your connection...  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 404 Not FoundThe requested url does not exist(22): 'http://ruby.taobao.org/mirrors/ruby/2.1/ruby-2.1.4.tar.bz2'Checking fallback: http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.bz2  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100 11.4M  100 11.4M    0     0   231k      0  0:00:50  0:00:50 --:--:-- 86209ruby-2.1.4 - #extracting ruby-2.1.4 to /usr/local/rvm/src/ruby-2.1.4....ruby-2.1.4 - #configuring.....................................................ruby-2.1.4 - #post-configuration..ruby-2.1.4 - #compiling....................................................................................Error running '__rvm_make -j1',showing last 15 lines of /usr/local/rvm/log/1453860140_ruby-2.1.4/make.logossl_ssl.c:139:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)     OSSL_SSL_METHOD_ENTRY(SSLv3_client),                           ^ossl_ssl.c:115:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }                                                                     ^Makefile:280: recipe for target 'ossl_ssl.o' failedmake[2]: *** [ossl_ssl.o] Error 1make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.1.4/ext/openssl'exts.mk:192: recipe for target 'ext/openssl/all' failedmake[1]: *** [ext/openssl/all] Error 2make[1]: Leaving directory '/usr/local/rvm/src/ruby-2.1.4'uncommon.mk:180: recipe for target 'build-ext' failedmake: *** [build-ext] Error 2++ return 2There has been an error while running make. Halting the installation.

于是去看/usr/local/rvm/log/1453860140_ruby-2.1.4/make.log最后的15行

ossl_ssl.c:115:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }                                                                     ^ossl_ssl.c:139:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)     OSSL_SSL_METHOD_ENTRY(SSLv3_client),                           ^ossl_ssl.c:115:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }                                                                     ^Makefile:280: recipe for target 'ossl_ssl.o' failedmake[2]: *** [ossl_ssl.o] Error 1make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.1.4/ext/openssl'exts.mk:192: recipe for target 'ext/openssl/all' failedmake[1]: *** [ext/openssl/all] Error 2make[1]: Leaving directory '/usr/local/rvm/src/ruby-2.1.4'uncommon.mk:180: recipe for target 'build-ext' failedmake: *** [build-ext] Error 2++ return 2

看这样应该是openssl的问题,于是我用uncommon.mk:180: recipe for target ‘build-ext’ fail 去外网搜,在S O找到了解决方法,应该能解决大部分的问题,但是我的不行

rvm pkg install opensslrvm install 2.2.1 --with-openssl-dir=$HOME/.rvm/usr

我重启之后再安装就变这样

root@kelly-pc:~# rvm install 2.2.1Searching for binary rubies, this might take some time.Found remote file https://rvm_io.global.ssl.fastly.net/binaries/debian/8/x86_64/ruby-2.2.1.tar.bz2Checking requirements for debian.Requirements installation successful.ruby-2.2.1 - #configureruby-2.2.1 - #download** Resuming transfer from byte position 14925824  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100 9240k  100 9240k    0     0  85841      0  0:01:50  0:01:50 --:--:--  525kNo checksum for downloaded archive, recording checksum in user configuration.ruby-2.2.1 - #validate archiveruby-2.2.1 - #extractruby-2.2.1 - #validate binaryruby-2.2.1 - #setupruby-2.2.1 - #gemset created /usr/local/rvm/gems/ruby-2.2.1@globalruby-2.2.1 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................ruby-2.2.1 - #generating global wrappers........ruby-2.2.1 - #gemset created /usr/local/rvm/gems/ruby-2.2.1ruby-2.2.1 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem listruby-2.2.1 - #generating default wrappers........

于是搜No checksum for downloaded archive, recording checksum in user configuration. 用下面代码安装

rvm reinstall ruby --disable-binary

还是一样,想哭。看来还是ssl的补丁问题,搜索recipe for target ‘ossl_ssl.o’ failed
终于github上有一老兄帮解决了,如下:

wget https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff -O openssl.patchrvm install --patch ./openssl.patch 2.2.1

终于,看我的!

root@kelly-pc:~# rvm install --patch ./openssl.patch 2.2.1ruby-2.2.1 - #removing src/ruby-2.2.1..Checking requirements for debian.Requirements installation successful.Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.2.1, this may take a while depending on your cpu(s)...ruby-2.2.1 - #downloading ruby-2.2.1, this may take a while depending on your connection...ruby-2.2.1 - #extracting ruby-2.2.1 to /usr/local/rvm/src/ruby-2.2.1....ruby-2.2.1 - #applying patch /root/./openssl.patch.ruby-2.2.1 - #applying patch /usr/local/rvm/patches/ruby/2.2.1/fix_installing_bundled_gems.patch.ruby-2.2.1 - #configuring.........................................................ruby-2.2.1 - #post-configuration..ruby-2.2.1 - #compiling................................................................................ruby-2.2.1 - #installing................ruby-2.2.1 - #making binaries executable..ruby-2.2.1 - #downloading rubygems-2.4.8  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100  437k  100  437k    0     0  28378      0  0:00:15  0:00:15 --:--:-- 98160No checksum for downloaded archive, recording checksum in user configuration.ruby-2.2.1 - #extracting rubygems-2.4.8....ruby-2.2.1 - #removing old rubygems.........ruby-2.2.1 - #installing rubygems-2.4.8......................ruby-2.2.1 - #gemset created /usr/local/rvm/gems/ruby-2.2.1@globalruby-2.2.1 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................ruby-2.2.1 - #generating global wrappers........ruby-2.2.1 - #gemset created /usr/local/rvm/gems/ruby-2.2.1ruby-2.2.1 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem listruby-2.2.1 - #generating default wrappers........ruby-2.2.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).Install of ruby-2.2.1 - #complete Ruby was built without documentation, to build it run: rvm docs generate-ri

一早上的时间就酱紫!

0 0
原创粉丝点击