RBENV安装更新为Ubuntu 22.04(Jammy Jellyfish)后失败

发布于 2025-01-24 22:27:59 字数 1381 浏览 3 评论 0原文

升级到Ubuntu 22.04(Jammy Jellyfish)后,我注意到Ruby 2.7.2的问题,所以我尝试安装2.7.2,当失败时,2.7.6(2.7.6),同样出现相同的错误:

$ rbenv install 2.7.6
Downloading ruby-2.7.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2
Installing ruby-2.7.6...

BUILD FAILED (Ubuntu 22.04 using ruby-build 20220426)

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

Last 10 log lines:
        from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
        from ./tool/rbinstall.rb:279:in `open_for_install'
        from ./tool/rbinstall.rb:845:in `block in install_default_gem'
        from ./tool/rbinstall.rb:835:in `each'
        from ./tool/rbinstall.rb:835:in `install_default_gem'
        from ./tool/rbinstall.rb:799:in `block in <main>'
        from ./tool/rbinstall.rb:950:in `block in <main>'
        from ./tool/rbinstall.rb:947:in `each'
        from ./tool/rbinstall.rb:947:in `<main>'
make: *** [uncommon.mk:373: do-install-all] Error 1

当前版本:当前版本:建议:

$ rbenv install 3.1.2
Downloading ruby-3.1.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz
Installing ruby-3.1.2...
Installed ruby-3.1.2 to /home/mslinn/.rbenv/versions/3.1.2

建议:建议关于如何在Jammy水母上安装Ruby 2.7.x?

After upgrading to Ubuntu 22.04 (Jammy Jellyfish) I noticed problems with Ruby 2.7.2, so I attempted to install 2.7.2, and when that failed, 2.7.6, which also failed with the same error:

$ rbenv install 2.7.6
Downloading ruby-2.7.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2
Installing ruby-2.7.6...

BUILD FAILED (Ubuntu 22.04 using ruby-build 20220426)

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

Last 10 log lines:
        from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
        from ./tool/rbinstall.rb:279:in `open_for_install'
        from ./tool/rbinstall.rb:845:in `block in install_default_gem'
        from ./tool/rbinstall.rb:835:in `each'
        from ./tool/rbinstall.rb:835:in `install_default_gem'
        from ./tool/rbinstall.rb:799:in `block in <main>'
        from ./tool/rbinstall.rb:950:in `block in <main>'
        from ./tool/rbinstall.rb:947:in `each'
        from ./tool/rbinstall.rb:947:in `<main>'
make: *** [uncommon.mk:373: do-install-all] Error 1

The current version installs:

$ rbenv install 3.1.2
Downloading ruby-3.1.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz
Installing ruby-3.1.2...
Installed ruby-3.1.2 to /home/mslinn/.rbenv/versions/3.1.2

Suggestions on how to get Ruby 2.7.x installed on Jammy Jellyfish?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

任性一次 2025-01-31 22:27:59

您的问题是Ubuntu 22.04安装了OpenSSL 3.0,但是构建日志中的错误消息:

OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required

要解决此问题,您需要自己编译OpenSSL。请参阅下面的说明。

基于此信息,我认为在Ubuntu上构建Ruby的最安全方法是:而不是依赖于系统Libssl-Dev软件包,下载和编译openssl 1.1.1纳入其自己的目录,然后用ruby​​_configure_opts = - with-openssl-dir =/path/to/my/openssl

答案在这里找到:
https://github.com/rbenv/ruby-build/ruby-build/discussions/19400

Your problem is Ubuntu 22.04 comes installed with OpenSSL 3.0, but the error message in your build log states:

OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required

To fix this you need to compile OpenSSL yourself. See the instructions below.

Based on this information, I would think that the safest way to build Ruby on Ubuntu 22.04 would be: instead of depending on the system libssl-dev package, download and compile OpenSSL 1.1.1 into its own directory, then point to that directory with RUBY_CONFIGURE_OPTS=--with-openssl-dir=/path/to/my/openssl while compiling with ruby-build.

The answer was found here:
https://github.com/rbenv/ruby-build/discussions/1940

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文