BUILD FAILED (macOS 12.7 on x86_64 using ruby-build 20231114)

367 Views Asked by At

I'm installing ruby 2.7.5 with command

RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.7.5

some lines of insallation messages:

*** Following extensions are not compiled: gdbm: Could not be configured. It will not be installed. Check ext/gdbm/mkmf.log for more details. openssl: Could not be configured. It will not be installed. Check ext/openssl/mkmf.log for more details. *** Fix the problems, then remove these directories and try again if you want.

ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.rbenv/versions/2.7.5" --with-openssl-dir=/usr/local/opt/[email protected] --enable-shared --with-readline-dir=/usr/local/opt/readline --with-libyaml-dir=/usr/local/opt/libyaml --with-gmp-dir=/usr/local/opt/gmp
-> make -j 8
-> make install

BUILD FAILED (macOS 12.7 on x86_64 using ruby-build 20231114)

You can inspect the build directory at /var/folders/rf/dg1gr4lj46zc99xgzz44w1sh0000gn/T/ruby-build.20231121211806.23241.x5R3Xd
See the full build log at /var/folders/rf/dg1gr4lj46zc99xgzz44w1sh0000gn/T/ruby-build.20231121211806.23241.log

last lines of log file:

/private/var/folders/rf/dg1gr4lj46zc99xgzz44w1sh0000gn/T/ruby-build.20231121201230.6263.hWKick/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
    from /private/var/folders/rf/dg1gr4lj46zc99xgzz44w1sh0000gn/T/ruby-build.20231121201230.6263.hWKick/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /private/var/folders/rf/dg1gr4lj46zc99xgzz44w1sh0000gn/T/ruby-build.20231121201230.6263.hWKick/ruby-2.7.5/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: *** [do-install-all] Error 1
external command failed with status 2

Can anybody please guide me how to overcome this installation error?

0

There are 0 best solutions below