Skip to content

Ruby Installation Problems

Jamie Macey edited this page Sep 7, 2018 · 3 revisions

Ruby Installation Issues

Problems installing ruby 2.3.x in arch linux

I've been trying to use asdf to manage my rubies on arch linux for some time and I couldn't because the installation failed no matter what I tried. After some research I managed to get it working by installing gcc5 and openssl-1.0 on Arch Linux and then using using:

CC=gcc-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig RUBY_EXTRA_CONFIGURE_OPTIONS="--with-openssl-dir=/usr/lib/openssl-1.0" asdf install ruby 2.3.3

That solves 2 problems:

  1. Ruby 2.3 not being compatible with openssl 1.1 (which is the default one on arch linux)
  2. Ruby 2.3 not compiling with gcc 7.1.1 on arch for some other different reason and causing a segfault (as explained here https://bugs.ruby-lang.org/issues/13635#change-65299)

GCC 7.3.1 builds Ruby 2.3.3 successfully, so there is no need to install or use another compiler:

PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig RUBY_EXTRA_CONFIGURE_OPTIONS="--with-openssl-dir=/usr/lib/openssl-1.0" asdf install ruby 2.3.3

Installing Ruby 2.3.x on Ubuntu

Similar to the above, I was getting build errors on Ubuntu 18.04:

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.

Running apt install libssl1.0-dev removed the libssl-dev package, and asdf install ruby 2.3.3 was able to build successfully.