Ruby-build: Can't build on Ubuntu 18.04 (bionic64)

Created on 28 Apr 2018  Â·  7Comments  Â·  Source: rbenv/ruby-build

I'm getting this error.

➜  REPO git:(develop) rbenv install
Downloading ruby-2.3.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.bz2
Installing ruby-2.3.4...

BUILD FAILED (Ubuntu 18.04 using ruby-build 20180424)

Inspect or clean up the working tree at /tmp/ruby-build.20180428105931.21933
Results logged to /tmp/ruby-build.20180428105931.21933.log

Last 10 log lines:
installing rdoc:              /home/vagrant/.rbenv/versions/2.3.4/share/ri/2.3.0/system
installing capi-docs:         /home/vagrant/.rbenv/versions/2.3.4/share/doc/ruby
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Try running `apt-get install -y libssl-dev` to fetch missing dependencies.

Configure options used:
  --prefix=/home/vagrant/.rbenv/versions/2.3.4
  LDFLAGS=-L/home/vagrant/.rbenv/versions/2.3.4/lib
  CPPFLAGS=-I/home/vagrant/.rbenv/versions/2.3.4/include
➜  REPO git:(develop) 

Even though I have libssl-dev package installed.

➜  REPO git:(develop) sudo apt install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version (1.1.0g-2ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
➜  REPO git:(develop)

Most helpful comment

Ruby < 2.4 is not compatible with openssl 1.1.
You need to install libssl1.0-dev.

All 7 comments

Ruby < 2.4 is not compatible with openssl 1.1.
You need to install libssl1.0-dev.

see https://github.com/rbenv/ruby-build/wiki#openssl-usrincludeopensslasn1_mach102-error-error-this-file-is-obsolete-please-update-your-software

@tristanrobert Million thanks it solved my problem.

@tristanrobert @hsbt Thanks guys this solved the issue for me.

Here is how to install older package with apt-get:

sudo apt-cache policy libssl-dev

libssl-dev:
Installed: (none)
Candidate: 1.1.0h-2.0+ubuntu16.04.1+deb.sury.org+1
Version table:
1.1.0h-2.0+ubuntu16.04.1+deb.sury.org+1 500
500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages
1.0.2g-1ubuntu4.12 500
500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
1.0.2g-1ubuntu4 500
500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Choose an older version from table, for me it worked with:

sudo apt-get install libssl-dev=1.0.2g-1ubuntu4.12

Thanks to @tristanrobert

Ruby < 2.4 is not compatible with openssl 1.1.
You need to install libssl1.0-dev.

Thank you

This solved it for me on Ubuntu 19
https://github.com/rvm/rvm/issues/4764#issuecomment-545827887

Was this page helpful?
0 / 5 - 0 ratings