I have a rails application with Rails 7 and Ruby 3 support, which is working well in my development machine with Ubuntu 22.04, ruby 3.0.2p107 and Rails 7.0.2.3.
Now I'm trying to set up Capistrano (version 3.17.0) in order to deploy the rails app to a server with Ubuntu 22.04. However, I'm unable to do so due to the following error:
SSHKit::Runner::ExecuteError: Exception while executing as username@server: rsa#set_key= is incompatible with OpenSSL 3.0
It seems that Capistrano is no compatible with OpenSSL 3.0, which is the default OpenSSL library in Ubuntu 22.04. I guess it's a bug, but I did not find any post reporting it. I did not find any workaround either.
I tried to fix the issue by installing OpenSSL 1.1.1 but the rails app still uses OpenSSL 3. Perhaps a solution could be to reinstall ruby 3 with OpenSSL 1.1.1 using the --with-openssl-dir option.
Any suggestion?
The reported error was due to the rails net-ssh gem not supporting OpenSSL 3.0.
Fortnunately, a new version of the net-ssh gem was released yesterday providing OpenSSL 3.0 support and hence fixing the issue.
Basically, adding
gem 'net-ssh', '7.0.0.beta1'
and running bundle install fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With