decidim / decidim-bulletin-board

GNU Affero General Public License v3.0
5 stars 6 forks source link

Make bulletin board compatible with ruby 3.1 and OpenSSL 3.0 #288

Closed microstudi closed 2 years ago

microstudi commented 2 years ago

Decidim 0.28 has bumb ruby version to 3.1. This ruby version supports OpenSSL 3.0 if shipped with the underlying OS.

However some dependent gems are not yet compatible with OpenSSL3:

Check if your system is using OpenSSL 3 or 1.1 by running:

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 3.0.2 15 Mar 2022

There is a workaround that allows to use ruby 3.1 by recompiling it using the old OpenSSL 1.1. For instance, in Ubuntu 22.04:

Manually install openssl 1.1 dev libraries (you might need some additional dev libraries in case the ./config step fails:

wget https://www.openssl.org/source/openssl-1.1.1n.tar.gz                         
tar xf openssl-1.1.1n.tar.gz
cd openssl-1.1.1n 
./config --prefix=/opt/openssl-1.1.1n --openssldir=/opt/openssl-1.1.1n shared zlib
make                  
make test
sudo make install
sudo rm -rf /opt/openssl-1.1.1n/certs
sudo ln -s /etc/ssl/certs /opt/openssl-1.1.1n

Manually compile ruby 3.1 with openssl-1.1, in case you are using rbenv, just exec:

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/openssl-1.1.1n rbenv install 3.1.1

Result:

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 1.1.1n  15 Mar 2022

With this, you can use bulletin_board again in Decidim using ruby 3.1