Rbenv @F36 - unable to install any ruby version

Hello,

I’m encountering the following issue when trying to install any ruby version with rbenv on Fedora 36 (clean install):

➜  ~ 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...
ruby-build: using readline from homebrew

BUILD FAILED (Fedora Linux 36 using ruby-build 20220426-3-g1038c07)

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

Last 10 log lines:
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/package.rb:44:in `<top (required)>'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/installer.rb:11:in `<top (required)>'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /tmp/ruby-build.20220512230708.3573.F78vJ7/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from ./tool/rbinstall.rb:713:in `<module:RbInstall>'
	from ./tool/rbinstall.rb:649:in `<main>'
make: *** [uncommon.mk:373: do-install-all] Error 1

I’ve also skimmed the log file and I found the following. Perhaps, it would tell more someone more accustomed with Ruby than me:

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

I’ve installed rbenv by using homebrew as described in the readme.

I need Ruby 2.7 to serve a local instance of Jekyll (githubpages).

Would you be able to help me out with resolving the issue with rbenv or suggesting a different way of installing Ruby 2.7? Is it possible to do that by using dnf?

I’d appreciate your help!

Btw. I’m seriously considering switching to Hugo.

1 Like

Also experiencing rbenv issue, it seems to be related to OpenSSL.

Also having the same issue. The log info isn’t very helpful.

Could you upload this file somewhere for everyone to inspect please? The “last 10 lines” don’t actually show the error location, just the import chain.

So, I found this fix, which seems to have worked for me:

3 Likes

I don’t think you need to compile OpenSSL1.1, there’s a compat package that should hopefully work:

1 Like

Hi, thank you for your help! The following did the trick for me:

sudo dnf groupinstall "Development Tools"
sudo dnf install perl-core zlib-devel   
sudo dnf install openssl1.1          
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/home/linuxbrew/.linuxbrew/opt/openssl@1.1 rbenv install 2.7.6
1 Like

Semi-official guide for Fedora:

Feel free to report issues you encouter (there’s a link on the page). It should always work.

1 Like