ruby-build icon indicating copy to clipboard operation
ruby-build copied to clipboard

Can't build on Ubuntu 18.04 (bionic64)

Open kewubenduben opened this issue 8 years ago • 7 comments

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)

kewubenduben avatar Apr 28 '18 11:04 kewubenduben

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

tristanrobert avatar Apr 29 '18 14:04 tristanrobert

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

hsbt avatar May 05 '18 11:05 hsbt

@tristanrobert Million thanks it solved my problem.

moa7ed avatar May 16 '18 21:05 moa7ed

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

MisterEnzo avatar May 30 '18 01:05 MisterEnzo

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

GoodJob avatar Jun 15 '18 11:06 GoodJob

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

Thank you

mihir-kumar-thakur avatar Aug 11 '19 11:08 mihir-kumar-thakur

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

karimamd avatar Apr 04 '20 08:04 karimamd