Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rbenv ruby 2.7.2 installation fails: "BUILD FAILED"

Tags:

ruby

rbenv

I am getting this strange error while trying to install ruby 2.7.2 using rbenv.

Does anybody know what the issue is?

$ 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

EDIT: Below is the content of the .log file (the full version is 197'000 lines long, so I can only post the last part).

And at the end, it says:

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

However, I DO have openssl installed (I use it). What am I missing?

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
like image 504
TomDogg Avatar asked Nov 06 '20 20:11

TomDogg


People also ask

Does Rbenv install Ruby?

rbenv is included in all installations of Bitnami Ruby stack that use system packages. It is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments. Every installed Ruby interpreter using rbenv is isolated in its own directory with its libraries and gems.

What is Rbenv Ruby-build?

ruby-build is a command-line utility that makes it easy to install virtually any version of Ruby, from source. It is available as a plugin for rbenv that provides the rbenv install command, or as a standalone program.

How do I install Rbenv on my Mac?

Installing rbenv with Homebrew First, install homebrew by running the following command in your terminal: /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Install rbenv by running the brew install rbenv command. Initialize rbenv by running the rbenv init command.


1 Answers

Long story short, I found out that libssl-dev and libreadline-dev were required, so this solved the problem:

sudo apt-get install libssl-dev libreadline-dev
like image 97
TomDogg Avatar answered Sep 18 '22 22:09

TomDogg