Bllergh. This is a real pain.
The openssl extension that ships with ruby 3.0 only compiles against openssl <= 1.1, but now openssl 3.0 is shipped in debian testing/unstable.
Ruby bug here: https://bugs.ruby-lang.org/issues/18658
Version >= 3.0 of the openssl rubygem does compile against openssl 3.0 though.
I use rbenv to manage ruby versions on my system, which uses ruby-build to manage installs.
I really don't want to compile or install a parallel openssl version, so I used a version of the process suggested by mame in the ruby bug to workaround the issue.
tl;dr trick rbenv/ruby-build into installing ruby without openssl, manually download the openssl 3.0 gem using not-ruby and install it.
Modify ruby-build to skip checking for openssl ($HOME/.rbenv/plugins/ruby-buildbin/ruby-build
):
diff --git a/bin/ruby-build b/bin/ruby-build
index ccfe468..b729b29 100755
--- a/bin/ruby-build
+++ b/bin/ruby-build
@@ -1141,7 +1141,7 @@ build_package_verify_openssl() {
)
}
- failed = %w[openssl readline zlib yaml].reject do |lib|
+ failed = %w[readline zlib yaml].reject do |lib|
begin
require lib
rescue LoadError
Install ruby 3.0:
$ RUBY_CONFIGURE_OPTS="--without-openssl" rbenv install 3.0.4
Download and install version of the openssl gem that compiles against openssl 3.0:
$ wget https://rubygems.org/downloads/openssl-3.0.0.gem
$ rbenv shell 3.0.4
$ gem install openssl-3.0.0.gem
Test the manually installed gem works by installing a new gem that needs to be downloaded over https:
$ gem install pdf-reader
Fetching pdf-reader-2.10.0.gem
Fetching ruby-rc4-0.1.5.gem
Fetching hashery-2.1.2.gem
Fetching Ascii85-1.1.0.gem
Fetching ttfunk-1.7.0.gem
Fetching afm-0.2.2.gem
Successfully installed ttfunk-1.7.0
Successfully installed ruby-rc4-0.1.5
Successfully installed hashery-2.1.2
Successfully installed Ascii85-1.1.0
Successfully installed afm-0.2.2
Successfully installed pdf-reader-2.10.0
Parsing documentation for ttfunk-1.7.0
Installing ri documentation for ttfunk-1.7.0
Parsing documentation for ruby-rc4-0.1.5
Installing ri documentation for ruby-rc4-0.1.5
Parsing documentation for hashery-2.1.2
Installing ri documentation for hashery-2.1.2
Parsing documentation for Ascii85-1.1.0
Installing ri documentation for Ascii85-1.1.0
Parsing documentation for afm-0.2.2
Installing ri documentation for afm-0.2.2
Parsing documentation for pdf-reader-2.10.0
Installing ri documentation for pdf-reader-2.10.0
Done installing documentation for ttfunk, ruby-rc4, hashery, Ascii85, afm, pdf-reader after 2 seconds
6 gems installed
@JuanitoFatas thanks for this! ;-)