Failed to install Ruby 3.1.4 on Ubuntu 22.04
- Dominant language
- Shell
- Stars
- 734
- Forks
- 156
- Avg merge
- 17h 6m
- Merged PRs (30d)
- 1
Description
I try to install Ruby 3.1.4 with asdf, and then curl throw a certificate error.
```bash
$ asdf install ruby 3.1.4 --verbose
To follow progress, use 'tail -f /tmp/ruby-build.20230720035635.50944.log' or pass --verbose
Downloading ruby-3.1.4.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz
error: failed to download ruby-3.1.4.tar.gz
BUILD FAILED (Ubuntu 22.04 using ruby-build 20230717)
```
The log content is below.
```
/tmp/ruby-build.20230720035635.50944.wduAeS ~/.asdf/downloads/ruby
curl: (60) SSL: no alternative certificate subject name matches target host name 'cache.ruby-lang.org'
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
```
I've tried the answer on [Stackoverflow ](https://stackoverflow.com/questions/75578416/cannot-install-ruby-with-asdf-on-ubuntu)of this problem, but still not work. And I also installed all package associated with OpenSSL.
```bash
$ apt list --installed | grep nss
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libcurl3-nss/now 7.81.0-1ubuntu1.11 amd64 [installed,upgradable to: 7.81.0-1ubuntu1.13]
libcurl4-openssl-dev/now 7.81.0-1ubuntu1.11 amd64 [installed,upgradable to: 7.81.0-1ubuntu1.13]
libjansson4/jammy,now 2.13.1-1.1build3 amd64 [installed,automatic]
libnss-systemd/jammy-updates,now 249.11-0ubuntu3.9 amd64 [installed,automatic]
libnss3/jammy-updates,jammy-security,now 2:3.68.2-0ubuntu1.2 amd64 [installed]
libxmlsec1-openssl/jammy,now 1.2.33-1build2 amd64 [installed,automatic]
openssh-client/jammy-updates,now 1:8.9p1-3ubuntu0.1 amd64 [installed,automatic]
openssh-server/jammy-updates,now 1:8.9p1-3ubuntu0.1 amd64 [installed]
openssh-sftp-server/jammy-updates,now 1:8.9p1-3ubuntu0.1 amd64 [installed]
openssl/jammy-updates,jammy-security,now 3.0.2-0ubuntu1.10 amd64 [installed,automatic]
python3-openssl/jammy,now 21.0.0-1 all [installed,automatic]
```
I also tried adding the `-k` argument in `~/.curlrc` to ignore certification errors, but asdf didn't apply my configuration.
By the way, I'm using Azure virtual machine. I don't know if it's Azure's network problem or Ruby's website SSL problem.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `asdf install ruby 3.1.4 --verbose` on Ubuntu 22.04 and inspect `/tmp/ruby-build.20230720035635.50944.wduAeS`; the issue also mentions `~/.curlrc` and an Azure virtual machine. Determine whether the certificate failure is caused by the environment or the Ruby plugin, and document the evidence and resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, shell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100