新手问题 Ruby 安装报错问题解决汇总

Chorder · 2018年02月27日 · 最后由 Chorder 回复于 2018年02月28日 · 4454 次阅读

国内关于安装报错解决的资源太少了,就算有,搜索引擎索引的也实在不怎么样。

这里新开一帖,把今后遇到的所有语言无关的报错全都记录在此,以供后人参考。

--------------------------------20180227--------------------------------

操作系统:kali Linux 2.0 rolling

rvm 版本:rvm 1.29.2

报错:

root@kali:/home/# rvm install 2.3.4
Warning, new version of rvm available '1.29.3', you are using older version '1.29.2'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
No binary rubies available for: debian/kali-rolling/x86_64/ruby-2.3.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for debian.
Installing requirements for debian.
Updating system..
Installing required packages: libreadline6-dev...
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.3.4, this may take a while depending on your cpu(s)...
ruby-2.3.4 - #downloading ruby-2.3.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
100 13.7M  100 13.7M    0     0    99k      0  0:02:21  0:02:21 --:--:-- 40960
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.4 - #extracting ruby-2.3.4 to /usr/local/rvm/src/ruby-2.3.4....
ruby-2.3.4 - #configuring..........................................................
ruby-2.3.4 - #post-configuration..
ruby-2.3.4 - #compiling.......................................................................................................................................................-
Error running '__rvm_make -j4',
showing last 15 lines of /usr/local/rvm/log/1519711179_ruby-2.3.4/make.log
In file included from object_tracing.c:16:0:
../../internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
                              ^
../../internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
linking shared-object json/ext/generator.so
make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.4/ext/json/generator'
linking shared-object objspace.so
make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.4/ext/objspace'
linking shared-object nkf.so
make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.4/ext/nkf'
make[1]: Leaving directory '/usr/local/rvm/src/ruby-2.3.4'
uncommon.mk:203: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
++ return 2
There has been an error while running make. Halting the installation.
root@kali:/home/# 

原因:libssl 导致的问题

解决方法:

apt-get install libssl1.0-dev

然后再执行安装命令就可以了

参考:https://github.com/rbenv/ruby-build/issues/1048

--------------------------------20180227--------------------------------

uncommon.mk:203: recipe for target 'build-ext' failed 把这句话扔谷歌 第一条答案就是解决办法=。=

别用百度了

hging 回复

正因为没有,所以才搬。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号