-
Notifications
You must be signed in to change notification settings - Fork 134
Ruby Installation Problems
Peter Boling edited this page Dec 21, 2024
·
4 revisions
You need this patch, which was created by a Ruby Core team member, specifically to reduce the number of error in the Ruby 3.0.7 build, so the build will succeed:
curl -s https://github.com/ruby/ruby/commit/1dfe75b0beb7171b8154ff0856d5149be0207724.patch -o ruby-3-0-7-arm64.patch
RUBY_APPLY_PATCHES=ruby-3-0-7-arm64.patch ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.0.7
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:
- Ruby 2.3 not being compatible with openssl 1.1 (which is the default one on arch linux)
- 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
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.