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

Ubuntu 22 - Error installing Ruby 2.6.9 #67

Closed
MarcusPetri opened this issue Apr 22, 2022 · 15 comments
Closed

Ubuntu 22 - Error installing Ruby 2.6.9 #67

MarcusPetri opened this issue Apr 22, 2022 · 15 comments

Comments

@MarcusPetri
Copy link

MarcusPetri commented Apr 22, 2022

Description

Problem installing Ruby 2.6.9 with RVM on freshly released Ubuntu 22.04 final version (downloaded and installed 4/22).

Steps to reproduce

  1. Just try to install Ruby 2.6.9 with RVM package as described in the README.

Expected behavior

Ruby 2.6.9 installed

Actual behavior

Just like Readme:

sudo apt-get install software-properties-common

sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm

sudo usermod -a -G rvm $USER

echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc

rvm user gemsets

rvm install ruby-2.6.9

Screenshot from 2022-04-22 17-46-21

Environment info

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
$ rvm install ruby-2.6.9
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-2.6.9.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-2.6.9, this may take a while depending on your cpu(s)...
ruby-2.6.9 - #downloading ruby-2.6.9, this may take a while depending on your connection...
ruby-2.6.9 - #extracting ruby-2.6.9 to /usr/share/rvm/src/ruby-2.6.9.....
ruby-2.6.9 - #configuring.......................................................................
ruby-2.6.9 - #post-configuration..
ruby-2.6.9 - #compiling..............................................................................|
Error running '__rvm_make -j8',
please read /home/mpetri/.rvm/log/1650658988_ruby-2.6.9/make.log
There has been an error while running make. Halting the installation.

make-log.txt

@fsdevblog
Copy link

fsdevblog commented Apr 23, 2022

the same error with 3.x versions..
As I understood, the problem that RVM cant work with the openssl v3. So I installed the v1 version of openssl and compiled ruby with the old version

installing the openssl v1

$ cd /usr/local/src/
$ sudo wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
$ sudo tar -xf openssl-1.1.1s.tar.gz
$ cd openssl-1.1.1s
$ sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
$ sudo make
$ sudo make install
$ sudo rmdir certs
$ sudo ln -sf /etc/ssl/certs/ certs

installing ruby

$ rvm install 3.1.2 --with-openssl-dir=/usr/local/ssl

I hope it will help

@raelgc
Copy link
Contributor

raelgc commented Apr 24, 2022

As this repository is dedicated to the Ubuntu installer, and this is a rvm issue, I'll close it. In the case you need more help, please, open it (or check if there is any related issue) in the rvm repository.

@raelgc raelgc closed this as completed Apr 24, 2022
@MarcusPetri
Copy link
Author

MarcusPetri commented Apr 24, 2022

@fsdevblog Thanks for raising this and to find a solution!

Optionally, you could install the openssl v1 provided with the PPA: sudo apt install openssl1.0

I tried before opening the issue

the same error with 3.x versions.. As I understood, the problem that RVM cant work with the openssl v3. So I installed the v1 version of openssl and compiled ruby with the old version

installing the openssl v1

$ cd /usr/local/src/
$ sudo wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
$ sudo tar -xf openssl-1.1.1c.tar.gz
$ cd openssl-1.1.1c
$ sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
$ sudo make
$ sudo make install

installing ruby

$ rvm install 3.1.2 --with-openssl-dir=/usr/local/ssl

I hope it will help

Thanks! Ruby installed! Now I have problem with bundle install:

$ bundle -v
Bundler version 1.17.3

$ bundle install
Fetching source index from https://gems.contribsys.com/

Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.contribsys.com/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.contribsys.com/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.contribsys.com/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Could not verify the SSL certificate for https://gems.contribsys.com/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see
http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.

@raelgc , can you reopen the issue?

@MikkelRBech
Copy link

The openssl you've compiled does not have access to the CA certificates. Symlink the certs/ dir to /etc/ssl/certs then it will work.

@diogeneshas
Copy link

@fsdevblog Thanks for raising this and to find a solution!

Optionally, you could install the openssl v1 provided with the PPA: sudo apt install openssl1.0

E: Unable to locate package openssl1.0
E: Couldn't find any package by glob 'openssl1.0'

@raelgc
Copy link
Contributor

raelgc commented Apr 27, 2022

@diogeneshas The package is available only if you added the PPA, but it'll not help on this case, as the required version is 1.1

@raelgc
Copy link
Contributor

raelgc commented Apr 29, 2022

Issue on parent repo: rvm/rvm#5209

@raelgc raelgc closed this as completed Apr 29, 2022
@raelgc
Copy link
Contributor

raelgc commented Apr 29, 2022

@fsdevblog I just updated your solution to use openssl1.1 version n (instead of version c) and added steps to link to /etc/ssl/certs.

@raelgc
Copy link
Contributor

raelgc commented May 23, 2022

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

You want, after sudo apt update, downgrade packages with:

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

@kidlab
Copy link

kidlab commented May 24, 2022

@raelgc Thanks for the tip, it worked well for me 👍

@DGaffney
Copy link

Great work here - thank you!

@ghost
Copy link

ghost commented Jan 31, 2023

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

You want, after sudo apt update, downgrade packages with:

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

Is there any way to block libssl-dev and openssl from updating? Because they are always updated and it is necessary to keep downgrading again!

@raelgc
Copy link
Contributor

raelgc commented Jan 31, 2023

@mpetri-wert, 3 possible solutions:

Hold upgrade using apt

Warning: This can lead to some problems during upgrade. Run at your own risk!

Hold a package: sudo apt-mark hold <package-name>
Remove the hold: sudo apt-mark unhold <package-name>
Show all packages on hold: sudo apt-mark showhold

Use local SSL source

Use the above solution in comment #67 (comment) (I keep updating it to point to the latest SSL 1.1.1 build)

Upgrade to Ruby 3.1.3

Few days ago I've built and uploaded a binary for Ruby 3.1.3, which appears to works fine in Ubuntu 22.04. Try the default install command: rvm install 3.1.3.

@hurricup
Copy link

hurricup commented Feb 8, 2023

a little correction to the script above. it should be:

$ sudo rmdir /usr/local/ssl/certs
$ sudo ln -sf /etc/ssl/certs/ /usr/local/ssl/certs

@duaneking
Copy link

duaneking commented Mar 3, 2023

with all the respect possible this defect was not fixed before it was closed as I'm still not able to install Ruby 2.6.2 on Ubuntu 22.04.2 LTS

Edit: rvm/rvm#5209

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

No branches or pull requests

9 participants