ill*_*ist 5 ruby linux-mint rbenv ruby-2.3 linux-mint-19
我刚刚安装了 Mint 19(Tara),并尝试使用安装 Ruby2.3.8并rbenv收到此错误。任何人都可以帮助我解决这个问题吗?
$ rbenv install 2.3.8 1 \xe2\x86\xb5\nDownloading ruby-2.3.8.tar.bz2...\n-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2\nInstalling ruby-2.3.8...\n\nWARNING: ruby-2.3.8 is past its end of life and is now unsupported.\nIt no longer receives bug fixes or critical security updates.\n\n\nBUILD FAILED (LinuxMint 19 using ruby-build 20200401-11-g12af1c3)\n\nInspect or clean up the working tree at /tmp/ruby-build.20200519084931.6743.ptWQ7b\nResults logged to /tmp/ruby-build.20200519084931.6743.log\n\nLast 10 log lines:\n../../internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]\nlinking shared-object json/ext/generator.so\nmake[2]: Leaving directory \'/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/json/generator\'\nlinking shared-object objspace.so\nmake[2]: Leaving directory \'/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/objspace\'\nlinking shared-object nkf.so\nmake[2]: Leaving directory \'/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/nkf\'\nmake[1]: Leaving directory \'/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8\'\nuncommon.mk:203: recipe for target \'build-ext\' failed\nmake: *** [build-ext] Error 2\n\nRun Code Online (Sandbox Code Playgroud)\n
看来问题不在于rbenv其他版本管理器,例如chruby和asdf。真正的问题是 openssl 和 ruby 2.3.x 的兼容性问题。
2.4之前的Ruby版本的openssl扩展与OpenSSL 1.1.x不兼容。目前,大多数附带 OpenSSL 1.1.0 的 Linux 发行版都有一个单独的 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
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题。
libgdbm5适用于 Ubuntu19 或 Mint19 及libgdbm6更高版本。
请MacOS and Home brew参阅https://github.com/rbenv/ruby-build/wiki#openssl-version-compatibility
| 归档时间: |
|
| 查看次数: |
5699 次 |
| 最近记录: |