Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build rubies 2.6.x, 2.7.x and 3.0.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu now provides openssl3 #5209

Closed
raelgc opened this issue Apr 29, 2022 · 90 comments

Comments

@raelgc
Copy link
Contributor

raelgc commented Apr 29, 2022

Description

Cannot build rubies 2.6.x and 2.7.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu 22.04 now provides openssl3.

Steps to reproduce

  1. Install rvm on Ubuntu 22.04.
  2. Try install a ruby, like rvm install 2.7.6.

Expected behavior

It compiles and install.

Actual behavior

It fails during install with cannot load such file -- openssl (LoadError):

*** Following extensions are not compiled:
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.
make[1]: Leaving directory '/usr/share/rvm/src/ruby-2.7.6'
making enc
make[1]: Entering directory '/usr/share/rvm/src/ruby-2.7.6'
make[1]: Nothing to be done for 'enc'.
make[1]: Leaving directory '/usr/share/rvm/src/ruby-2.7.6'
making trans
make[1]: Entering directory '/usr/share/rvm/src/ruby-2.7.6'
make[1]: Nothing to be done for './enc/trans'.
make[1]: Leaving directory '/usr/share/rvm/src/ruby-2.7.6'
making encs
make[1]: Entering directory '/usr/share/rvm/src/ruby-2.7.6'
make[1]: Nothing to be done for 'encs'.
make[1]: Leaving directory '/usr/share/rvm/src/ruby-2.7.6'
./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" --exclude=doc
installing binary commands:         /usr/share/rvm/rubies/ruby-2.7.6/bin
installing base libraries:          /usr/share/rvm/rubies/ruby-2.7.6/lib
installing arch files:              /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0/x86_64-linux
installing pkgconfig data:          /usr/share/rvm/rubies/ruby-2.7.6/lib/pkgconfig
installing extension objects:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0/x86_64-linux
installing extension objects:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0/x86_64-linux
installing extension objects:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/vendor_ruby/2.7.0/x86_64-linux
installing extension headers:       /usr/share/rvm/rubies/ruby-2.7.6/include/ruby-2.7.0/x86_64-linux
installing extension scripts:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0
installing extension scripts:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/site_ruby/2.7.0
installing extension scripts:       /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/vendor_ruby/2.7.0
installing extension headers:       /usr/share/rvm/rubies/ruby-2.7.6/include/ruby-2.7.0/ruby
installing command scripts:         /usr/share/rvm/rubies/ruby-2.7.6/bin
installing library scripts:         /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0
installing common headers:          /usr/share/rvm/rubies/ruby-2.7.6/include/ruby-2.7.0
installing manpages:                /usr/share/rvm/rubies/ruby-2.7.6/share/man (man1, man5)
installing default gems from lib:   /usr/share/rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)
                                    benchmark 0.1.0
/usr/share/rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
	from /usr/share/rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /usr/share/rvm/src/ruby-2.7.6/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:380: do-install-nodoc] Error 1
++ return 2

Environment info

system:

  system:
    uname:        "Linux mini-pc 5.15.31-051531-generic #202203230544 SMP Wed Mar 23 10:32:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux"
    name:         "Ubuntu"
    version:      "22.04"
    architecture: "x86_64"
    bash:         "/usr/bin/bash => GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)"
    zsh:          " => not installed"
    remote_path:  "ubuntu/22.04/x86_64"

  rvm:
    version:      "1.29.12-next (master)"
    updated:      "1 hour 7 minutes 38 seconds ago"
    path:         "/usr/share/rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  homes:
    gem:          "not set"
    ruby:         "not set"

  binaries:
    ruby:         ""
    irb:          ""
    gem:          ""
    rake:         ""

  environment:
    PATH:         "/home/rael/.local/bin:/home/rael/.nvm/versions/node/v14.17.6/bin:/home/rael/.cargo/bin:/home/rael/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/share/rvm/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: ""
    IRBRC:        ""
    RUBYOPT:      ""
    gemset:       ""
@raelgc raelgc changed the title Cannot build rubies on Ubuntu 22.04 because rvm relies on openssl1.1 and Ubuntu now provides openssl3 Cannot build rubies 2.6.x and 2.7.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu now provides openssl3 Apr 29, 2022
@havenwood
Copy link
Member

I'd suggest we fix this by bumping the default gem for openssl to version 3 when Ruby 2.6-2.7 are installed on Ubuntu 22.04+. See https://bugs.ruby-lang.org/issues/18658

@havenwood
Copy link
Member

MacPorts and Homebrew also encounter this issue.

@pkuczynski
Copy link
Member

PR is welcome!

@reckerswartz
Copy link

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

@SCV-MatiasFazzolari
Copy link

SCV-MatiasFazzolari commented May 3, 2022

IDK if it may be useful but, in Ubuntu 22.04, the rvm pkg workaround and ruby 3.0.x installation ran successfully, but gems like pg shoots segmentation faults and basically the installation is useless (if you need that gem).

In order to test, I removed completely rvm and reinstalled (to ensure it were fresh install). ruby version 3.1.2 worked correctly with no special workarounds and segmentation fault has gone.

@andylamp
Copy link

andylamp commented May 4, 2022

I concur - this is an LTS release also, so more people will encounter this as they are prompted to upgrade to it!

@raelgc raelgc changed the title Cannot build rubies 2.6.x and 2.7.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu now provides openssl3 Cannot build rubies 2.6.x, 2.7.x and 3.0.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu now provides openssl3 May 4, 2022
@raelgc
Copy link
Contributor Author

raelgc commented May 4, 2022

@SCV-MatiasFazzolari Ruby 3.0 is also suffering from the same issue. Ruby 3.1 is properly requiring openssl 3, which is included on Ubuntu 22.04.

@andylamp
Copy link

andylamp commented May 4, 2022

right, rvm however does not have any available rubies for 3.1 branch, in my installation it lists the following:

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

and version:

rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

@havenwood
Copy link
Member

right, rvm however does not have any available rubies for 3.1 branch, in my installation it lists the following:

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

and version:

rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

Run rvm get head to update RVM.

@charlietag
Copy link

right, rvm however does not have any available rubies for 3.1 branch, in my installation it lists the following:

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

and version:

rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

Run rvm get head to update RVM.

So does it mean that there will be no more stable release anymore? right ?

@raelgc
Copy link
Contributor Author

raelgc commented May 11, 2022

So does it mean that there will be no more stable release anymore? right ?

Wrong. But in this meanwhile, you have the option to get the latest, where newest ruby is present.

@charlietag
Copy link

I see. Thanks for the quick reply!

@JohnSmall
Copy link

I can't run the latest Ruby because reasons, and I don't want to faff about with openssl PPAs and manual symlinks. Either it works out of the box or it doesn't. If this is going to be sorted out soon then in the meantime I'll run an older Ubuntu in a virtual box. If it's not going to be sorted out then I think I'll abandon the RVM plus Capistrano ecology altogether and go down the Docker + AWS Containers route.

Which I've been putting off as long as possible since 'cap production deploy' is so easy compared to a Docker deployment. Sigh

@havenwood
Copy link
Member

I can't run the latest Ruby because reasons, and I don't want to faff about with openssl PPAs and manual symlinks. Either it works out of the box or it doesn't. If this is going to be sorted out soon then in the meantime I'll run an older Ubuntu in a virtual box. If it's not going to be sorted out then I think I'll abandon the RVM plus Capistrano ecology altogether and go down the Docker + AWS Containers route.

Which I've been putting off as long as possible since 'cap production deploy' is so easy compared to a Docker deployment. Sigh

As a comment mentions above, you can rvm pkg install openssl to stick with older OpenSSL in the short term. I do think patches can be prepared to backport OpenSSL 3 but when I took a stab at preparing a patch it broke Digest and Socket. I think Ubuntu did backport OpenSSL 3, but we'd need to prepare patches from each version of Ruby (since they ship different OpenSSL versions) and figure out how to selectively apply them on systems with OpenSSL 3.

There's a ticket open to switch Ruby 3.0 to OpenSSL 3, which I think is a good idea, but it's not clear when or if that will happen. Ruby maintainers made a choice to support widely used older systems when there wasn't a clear way to have both versions of OpenSSL work.

This is an upstream issue and a community supported project. @JohnSmall, I understand you don't want to be bothered fixing this even for just yourself, but I don't use RVM myself and am happy to pair with anyone who'd like to find Ubuntu's backport or work on crafting them. I get it it's frustrating for things to not work, but please be considerate of open source contributors and maintainers who are just volunteering time and owe you nothing. You're welcome to use RVM or not use RVM!

@havenwood
Copy link
Member

A side note, but I think updating our statically compiled binaries for 22.04 would really help mitigate this for Ubuntu. Folk are saying the precompiled binary seems to work on 22.04, so it would be great to add aliases and definitions so that gets installed.

@raelgc
Copy link
Contributor Author

raelgc commented May 23, 2022

Ok, finally I've backported openssl1.1 to 22.04 for those using the Ubuntu dedicated package.

You want, after sudo apt update, downgrade libssl-dev with:

sudo apt install libssl-dev=1.1.1l-1ubuntu1.4

@qs5779
Copy link

qs5779 commented May 29, 2022

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

resolved my issue on Fedora 36

@lewiseason
Copy link

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

resolved my issue on Fedora 36

Me too on 3.0, except that openssl still has the LetsEncrypt ISRG cert in its bundle:

require 'faraday'
Faraday.get('https://letsencrypt.org')

# /home/leason/.rvm/gems/ruby-3.0.4@atlas/gems/net-protocol-0.1.3/lib/net/protocol.rb:46:in `connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (certificate has expired) (Faraday::SSLError)

Any clues or workarounds?

@duaneking
Copy link

rvm install 2.6.2
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-2.6.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..
Installing required packages: libssl-dev...
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-2.6.2, this may take a while depending on your cpu(s)...
ruby-2.6.2 - #downloading ruby-2.6.2, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.9M 100 13.9M 0 0 19.1M 0 --:--:-- --:--:-- --:--:-- 19.1M
ruby-2.6.2 - #extracting ruby-2.6.2 to /usr/share/rvm/src/ruby-2.6.2.....
ruby-2.6.2 - #configuring.......................................................................
ruby-2.6.2 - #post-configuration..
ruby-2.6.2 - #compiling....................................................................................................................
Error running '__rvm_make -j20',
please read /usr/share/rvm/log/1677877956_ruby-2.6.2/make.log

There has been an error while running make. Halting the installation.

Same issue, and this is using rvm master.

@gerryhd
Copy link

gerryhd commented Mar 5, 2023

When will these binaries be available given that this bug was closed as fixed?

Asking because in my tests, its currently impossible to install ruby 2.6.2 on ubuntu, and its blocking upgrade efforts to get away from old versions.

my suggestion - use asdf instead.

@duaneking
Copy link

duaneking commented Mar 8, 2023

my suggestion - use asdf instead.

Thanks. ASDF is a much better install experience, but it has worse error messages that are somehow even more ambiguous; it also seems slower on my system. But I'm able to get things working locally, if I disable rdoc install, as that seems to be killing it after the ssl stuff is patched.

On Ubuntu 20.04 this worked for me after I imploded rvm to get SOME of the versions of ruby I need installed to allow the code to be updated; But its insane IMHO that if you have too new a ruby version, that gemswill not work.

asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git

asdf plugin-update ruby

asdf install ruby 1.8.7 <--- STILL FAILS EVEN WITH RDOC DISABLED

asdf install ruby 1.9.3-p551

asdf install ruby 2.1.2

RUBY_CONFIGURE_OPTS=--disable-install-doc asdf install ruby 2.2.2

RUBY_CONFIGURE_OPTS=--disable-install-doc asdf install ruby 2.3.3

asdf install 2.6.2

asdf install 2.7.3

Thing is, rdoc install is a CRITICAL requirement for some gems and apps because back then that is used for inspection to look at and detect things; so simply doing the above or setting 'echo "gem: --no-document" > ~/.gemrc' would not work for me in all cases, even if it would help others (and since it would help others, I'm posting this here, as breadcrumbs for the starving; if it works for you, have the bread above and enjoy.).

I'm still trying to get the ruby 1.8.7 version I need installed so I can start to upgrade code away from it, as I'm being told by rails compatibility guides that specific versions of ruby are explicitly required with many versions of rails.

I remember being told that Ruby was about giving developers joy... and this has not been a joyful experience.

@mathieujobin
Copy link
Contributor

Ruby does bring joy, but this isn't about the language. You are asking tools that did not exist few years ago to install unsupported version of a language that was released back when Windows 98 was still popular.

Like hooking up an Oculus Quest on 20 years old PC.

My best suggestion is you stick with Ubuntu 18.04 for anything below 2.4.
But the real suggestion, is whatever software which needs Ruby < 2.7, needs to be upgraded

2.7 goes EOL soon as well.

@duaneking
Copy link

Thank you, I'm fully aware this is old stuff; I remember when Ruby was released in the 90's. I remember because I had multiple CRT's on my home workstation and I remember loading the announcement on one screen while looking at Linux kernel docs on the other.

Rails is the big issue here; it wouldn't be so bad if all I had to do was update ruby to a new enough version, but because it's rails and Ruby doesn't like things that are "too new", that complicates things immensely; as a result I've had to plot out an update path based on googling that includes the dozen different versions of the languages, and I know that's not going to be everything.. so I'm understandably frustrated by this developer experience.

It should also be noted that I'm also looking at go code that is also very old (2016), and it only needs to be made into a module by the addition of 2 files to be updated. That easy upgrade path is making me have a lot more respect for golang.

@rebase-master
Copy link

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

This worked for me as well on Ubuntu 22.04. Thanks a lot. 👍

@duaneking
Copy link

I'm being told that people are going out of their way to refix things that were previously broken on the upgrade path; I'm very thankful for that. I think it's critical from an engineering perspective that no matter the language, we be allowed to upgrade code out of older versions of things and maintain projects; If your working on things to allow this currently broken upgrade path to exist again in the future, I am thankful.

@djfrodo
Copy link

djfrodo commented May 4, 2023

This is still an issue for me:

rvm reinstall all --force
ruby-2.7.7 - #removing src/ruby-2.7.7..
ruby-2.7.7 - #removing rubies/ruby-2.7.7..
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/22.04/x86_64/ruby-2.7.7.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.7.7 - #configure
ruby-2.7.7 - #download
ruby-2.7.7 - #validate archive
ruby-2.7.7 - #extract
ruby-2.7.7 - #validate binary
Libraries missing for ruby-2.7.7: libcrypto.so.1.1,libssl.so.1.1. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, trying to compile.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-2.7.7, this may take a while depending on your cpu(s)...
ruby-2.7.7 - #downloading ruby-2.7.7, this may take a while depending on your connection...
ruby-2.7.7 - #extracting ruby-2.7.7 to /usr/share/rvm/src/ruby-2.7.7.....
ruby-2.7.7 - #configuring.............................................................
ruby-2.7.7 - #post-configuration..
ruby-2.7.7 - #compiling.................................................................................|
ruby-2.7.7 - #installing..............
Error running '__rvm_make install',
please read /usr/share/rvm/log/1683190612_ruby-2.7.7/install.log
There has been an error while running make install. Halting the installation.

@gtrujillop-bs
Copy link

Worked for me on Ubuntu 22.04. Thanks!

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

@gduprey
Copy link

gduprey commented Oct 25, 2023

The problem with the recommendations to use the rvm-local openssl install is that any gems (like the pg gem for postgresql) that compile native code and use openssl will wind up being incompatible with the ruby that is built with a different version of openssl and the ruby process will dump core when trying to fire up that gem.

And I agree with others that point out that simply going to a newer version of ruby, especially if dependent on rails, is often not a practical solution - it requires immense time to test, adjust, etc, etc.

This solution worked for me - applying a patch that simply makes the deprecation errors into warnings and allowing rvm to build a ruby that works with the system openssl install (and thus any native built gems work too).

Its not a true fix. It will obviously break in some future release of openssl as these are deprecation warnings being ignored, but for the moment (ubuntu 22, openssl 3.0), this works.

Note: someone already included the necessary patch as part of the rvm/ruby 2.5.9 install, but the patch should work with any version of ruby from 2.5.9 on (I use it with 2.6.5 and it's perfect). To build with the patch (which is included in the rvm downloads - reinstall/update rvm if it's missing), use the command:

$ rvm install 2.6.5 --patch $HOME/.rvm/patches/ruby/2.5.9/opensslv30.patch

Note: this assumes you are building ruby/rvm in your home directory - the patch file will exist whenever rvm is installed, so if using a different location for rvm, adjust above accordingly

@JUDE-EQ
Copy link

JUDE-EQ commented Jan 3, 2024

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

Still works <3

@gduprey
Copy link

gduprey commented Jan 3, 2024

Using the --with-openssl-dir will only work if none of your gems depend on it.

Per my earlier example, the pg gem for PostgreSQL will not build correctly or work at all if you do this as it has to be built with the same OpenSSL version that ruby was built with.

If none of your gems use/link/build against openssl, then just building with the --with-openssl-dir option will work. But it will fail and you'll need to drop back to the patch I mentioned in the previous article if any gems use/build with openssl too

@TeTiRoss
Copy link

TeTiRoss commented Jan 11, 2024

$ rvm install 2.6.5 --patch $HOME/.rvm/patches/ruby/2.5.9/opensslv30.patch

@gduprey unfortunately this patch does not work for ruby 2.7.6. Installation gives the same cannot load such file -- openssl error as without it.

@pavels
Copy link

pavels commented Jan 17, 2024

Here is patch for 2.4 if somebody needs it https://gist.github.com/pavels/f6a8cd7e33d3d5a3125308fa6a429367

@ShinyKiwis
Copy link

Ok, finally I've backported openssl1.1 to 22.04 for those using the Ubuntu dedicated package.

You want, after sudo apt update, downgrade libssl-dev with:

sudo apt install libssl-dev=1.1.1l-1ubuntu1.4

For people using Linux Mint 21, rvm pkg install openssl and install ruby with rvm install 3.0.0 -C --with-openssl-dir=/usr/share/rvm/usr/ may lead to segmentation fault, install the libssl-dev as above and reinstall the ruby will work.

@rizqirizqi
Copy link

I'm currently using Linux Mint 21.3, and the rvm pkg install openssl solution above works for me.

noahfpf added a commit to FrontPorchForum/comfortable-mexican-sofa that referenced this issue Mar 26, 2024
…ibility error:

> LoadError: cannot load such file -- openssl

rvm/rvm#5209

Also updated Chrome drive to `119.0.6045.105`
noahfpf added a commit to FrontPorchForum/comfortable-mexican-sofa that referenced this issue Mar 27, 2024
…0, and Ruby 3.0

Droped Ruby 3.0 to fix rvm / Ubuntu 22 / openssl 1 incompatibility error:
> LoadError: cannot load such file -- openssl
See rvm/rvm#5209 for more

Updated gems:

- Updated `selenium-webdriver` to latest to resolve a test error
- Updated puma gem to fix rack 3 incompatibility
- Updated mocha gem to fix Minitest incompatibility:
  > NameError: uninitialized constant MiniTest

Updated travis configuration:

- Update travis to Ubuntu jammy to fix node error:
  > node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
- Updated Node (in travis) to 18
- Updated Chrome installation on travis to use addon to fix version mismatch

Other fixes:

- Fixed/removed some outdated config settings
- Fixed Rubocop warning by using `delete_prefix!`
- Ignored rubocop warning for Ruby 3.1 hash syntax
- Fixed error trying to deserialize certain unsafe classes via YAML:
  > Psych::DisallowedClass: Tried to load unspecified class: ActiveSupport::TimeWithZone
- Removed `coveralls` (code coverage reporter), which is unmaintained and throwing an error:
  > OpenSSL::SSL::SSLError
  > SSL_connect returned=1 errno=0 peeraddr=104.26.4.137:443 state=error: no protocols available

Note that a few tests deserialize blank strings as an empty string in dev and
as a one character whitespace string (`"\s"`) on travis.  I tried stripping the
end-of-line spaces to make the tests behave the same in both environments, but
that didn't work for some reason.  So expect tests to pass on travis, but possibly
not in a dev env.
@marcelom87
Copy link

Hey guys,
Was able to solve my issue with fedora as follows:

sudo dnf install openssl1.1-devel  --allowerasing

rvm autolibs disable
rvm requirements
rvm install 2.7.2 --with-openssl-dir=$HOME/.rvm/usr

In summary, I forced installing openssl1.1-devel and made rvm skip checking requirements on fedora. Otherwise, rvm kept asking to install openssl-devel, which will refer to openssl3 that will break the compilation of older versions of ruby.

Cheers,

@RossBarnie
Copy link

Just to be clear to anyone else who comes across this issue, the fixes above will make your project work under Ruby 2.7 but you should really be updating to at least Ruby 3.1 because 2.7 has been EOL for a year now and 3.0 is EOL as of 1st April 2024 (see https://www.ruby-lang.org/en/downloads/branches/). By using these old ruby versions you may be putting your users at risk.

@jesussuarz
Copy link

for short term use:

rvm pkg install openssl

next

rvm install ruby-2.7.x --with-openssl-dir=$HOME/.rvm/usr

This is what worked for me. (it was a ubuntu 22.04 wsl2 in windows)

rvm pkg install openssl
rvm install ruby-2.7.6 --force --with-openssl-dir=/usr/local/rvm/usr

@msangel
Copy link

msangel commented Oct 22, 2024

If installed from ubuntu_rvm this is the receipt:

rvm pkg install openssl
rvm install 3.0.0 -C --with-openssl-dir=/usr/share/rvm/usr/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests