rbenv
rbenv copied to clipboard
Build fails on Ubuntu 18 Bionic Beaver
When I run the playbook on Bionic Beaver installing Ruby 2.1.5 I get a fatal error at the build step. The error output shows this:
Downloading ruby-2.1.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.bz2
Installing ruby-2.1.5...
WARNING: ruby-2.1.5 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
BUILD FAILED (Ubuntu 18.04 using ruby-build 20190320)
Inspect or clean up the working tree at /tmp/ruby-build.20190326160938.15756
Results logged to /tmp/ruby-build.20190326160938.15756.log
Last 10 log lines:
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling callback-7.c
compiling callback-8.c
installing default callback libraries
linking shared-object dl/callback.so
make[2]: Leaving directory '/tmp/ruby-build.20190326160938.15756/ruby-2.1.5/ext/dl/callback'
make[1]: Leaving directory '/tmp/ruby-build.20190326160938.15756/ruby-2.1.5'
uncommon.mk:180: recipe for target 'build-ext' failed
Seems to be an issue with the openssl package, and it affects general building of older Ruby versions. It was changed from 1.0.x to 1.1.x in Ubuntu 18, and the new version doesn't play nicely with older Ruby.
More info here: https://stackoverflow.com/a/45756844
It looks like installing the package libssl1.0-dev makes the necessary version of openssl available for compiling when Ruby 2.1.5 is built, and fixes the issue...