簡體   English   中英

Ruby 2.3.8 在 mint 中使用 rbenv 安裝錯誤 | uncommon.mk:203:目標“build-ext”的配方失敗

[英]Ruby 2.3.8 installation error using rbenv in mint | uncommon.mk:203: recipe for target 'build-ext' failed

我剛剛安裝了 Mint 19(Tara) 並嘗試使用rbenv安裝 Ruby 2.3.8並收到此錯誤。有人可以幫我解決這個問題嗎?

$ rbenv install 2.3.8                                                                                                                                                              1 ↵
Downloading ruby-2.3.8.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2
Installing ruby-2.3.8...

WARNING: ruby-2.3.8 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.


BUILD FAILED (LinuxMint 19 using ruby-build 20200401-11-g12af1c3)

Inspect or clean up the working tree at /tmp/ruby-build.20200519084931.6743.ptWQ7b
Results logged to /tmp/ruby-build.20200519084931.6743.log

Last 10 log lines:
../../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 '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/json/generator'
linking shared-object objspace.so
make[2]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/objspace'
linking shared-object nkf.so
make[2]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/nkf'
make[1]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8'
uncommon.mk:203: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2

似乎問題不rbenv ,而在於其他版本管理器,如chrubyasdf 真正的問題是與 openssl 和 ruby 2.3.x 的兼容性問題。

Ruby 2.4之前版本的openssl擴展與OpenSSL 1.1.x不兼容。 At the moment, most Linux distributions that come with OpenSSL 1.1.0 have a separate package for OpenSSL 1.0.x.

您需要安裝早期版本的 OpenSSL 或使用 ruby 2.4.x。

sudo apt-get install autoconf bison build-essential libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev libdb-dev


sudo apt-get install libssl1.0-dev

這解決了我的問題。

筆記:

libgdbm5或 Mint19 的libgdbm6和更高版本的 libgdbm6。

對於MacOS and Home brew請參閱https://github.com/rbenv/ruby-build/wiki#openssl-version-compatibility

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM