簡體   English   中英

rbenv ruby​​ 2.7.2 安裝失敗:“BUILD FAILED”

[英]rbenv ruby 2.7.2 installation fails: "BUILD FAILED"

我在嘗試使用 rbenv 安裝 ruby​​ 2.7.2 時遇到這個奇怪的錯誤。

有人知道是什么問題嗎?

$ rbenv install 2.7.2
Installing ruby-2.7.2...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20201005-4-g4761049)

Inspect or clean up the working tree at /tmp/ruby-build.20201106211003.49727.I05SRV
Results logged to /tmp/ruby-build.20201106211003.49727.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

編輯:下面是 .log 文件的內容(完整版有 197'000 行,所以我只能發布最后一部分)。

最后,它說:

ruby-2.7.2/lib/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- openssl (LoadError)

但是,我確實安裝了 openssl(我使用它)。 我錯過了什么?

generating x86_64-linux-fake.rb
x86_64-linux-fake.rb updated
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --rdoc-output=".ext/rdoc" --html-output=".ext/html"
installing binary commands:         /home/tom/.rbenv/versions/2.7.2/bin
installing base libraries:          /home/tom/.rbenv/versions/2.7.2/lib
installing arch files:              /home/tom/.rbenv/versions/2.7.2/lib/ruby/2.7.0/x86_64-linux
installing pkgconfig data:          /home/tom/.rbenv/versions/2.7.2/lib/pkgconfig
installing extension objects:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/2.7.0/x86_64-linux
installing extension objects:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0/x86_64-linux
installing extension objects:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/vendor_ruby/2.7.0/x86_64-linux
installing extension headers:       /home/tom/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux
installing extension scripts:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/2.7.0
installing extension scripts:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0
installing extension scripts:       /home/tom/.rbenv/versions/2.7.2/lib/ruby/vendor_ruby/2.7.0
installing extension headers:       /home/tom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby
installing rdoc:                    /home/tom/.rbenv/versions/2.7.2/share/ri/2.7.0/system
installing html-docs:               /home/tom/.rbenv/versions/2.7.2/share/doc/ruby
installing capi-docs:               /home/tom/.rbenv/versions/2.7.2/share/doc/ruby
installing command scripts:         /home/tom/.rbenv/versions/2.7.2/bin
installing library scripts:         /home/tom/.rbenv/versions/2.7.2/lib/ruby/2.7.0
installing common headers:          /home/tom/.rbenv/versions/2.7.2/include/ruby-2.7.0
installing manpages:                /home/tom/.rbenv/versions/2.7.2/share/man (man1, man5)
installing default gems from lib:   /home/tom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)
                                    benchmark 0.1.0
/tmp/ruby-build.20201107153545.4938.VEdjtZ/ruby-2.7.2/lib/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- openssl (LoadError)
    from /tmp/ruby-build.20201107153545.4938.VEdjtZ/ruby-2.7.2/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
    from /tmp/ruby-build.20201107153545.4938.VEdjtZ/ruby-2.7.2/lib/rubygems/specification.rb:2430:in `to_ruby'
    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

長話短說,我發現需要libssl-devlibreadline-dev ,所以這解決了問題:

sudo apt-get install libssl-dev libreadline-dev

在 RHEL8/CENTOS8 中:

sudo yum install readline-devel openssl-devel

假設你已經跑了:

sudo yum groupinstall "Development Tools"

暫無
暫無

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

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