Ruby 3.1.3 fails to build on Fedora 42 #2529
-
Hello, I am unable to build Ruby 3.1.3 or any older versions on Fedora 42. Has anyone faced a similar issue? $ ~ rbenv install 3.1.3
==> Downloading ruby-3.1.3.tar.gz...
-> curl -q -fL -o ruby-3.1.3.tar.gz https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.3.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19.9M 100 19.9M 0 0 34.0M 0 --:--:-- --:--:-- --:--:-- 34.0M
==> Installing ruby-3.1.3...
WARNING: ruby-3.1.3 is nearing its end of life.
It only receives critical security updates, no bug fixes.
-> ./configure "--prefix=$HOME/.rbenv/versions/3.1.3" --enable-shared --with-ext=openssl,psych,+
-> make -j 16
BUILD FAILED (Fedora Linux 42 on x86_64 using ruby-build 20250430)
You can inspect the build directory at /tmp/ruby-build.20250505130648.221804.prcCh7
See the full build log at /tmp/ruby-build.20250505130648.221804.log Build error:
Full log: Ruby 3.3.6 seems to build just fine: $ ~ rbenv install 3.3.6
==> Downloading ruby-3.3.6.tar.gz...
-> curl -q -fL -o ruby-3.3.6.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.6.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21.1M 100 21.1M 0 0 31.6M 0 --:--:-- --:--:-- --:--:-- 31.6M
==> Installing ruby-3.3.6...
-> ./configure "--prefix=$HOME/.rbenv/versions/3.3.6" --enable-shared --with-ext=openssl,psych,+
-> make -j 16
-> make install
==> Installed ruby-3.3.6 to /home/erikas/.rbenv/versions/3.3.6
NOTE: to activate this Ruby version as the new default, run: rbenv global 3.3.6 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
Hi, I'm not a Fedora user, but I haven't seen this particular issue reported to us until now. Looking at the Ruby source code repo, it looks like they've made a change affecting the line where your error stems from: ruby/ruby@4574191 The change is only from Ruby 3.2 onwa 8000 rd; maybe it's some kind of fix that is not going to be backported to Ruby 3.1? It also seems to reference a system dependency called "gperf", so that's another lead for you to check (e.g. you could see which gperf version you have installed via your package manager). So, although I'm not sure how to avoid this error, you have some options:
|
Beta Was this translation helpful? Give feedback.
-
As a temporary workaround, I have successfully compiled older Ruby versions on a Fedora 41 virtual machine I believe the main culprit is the $ ~ gcc --version
gcc (GCC) 15.1.1 20250425 (Red Hat 15.1.1-1) Fedora 41 $ ~ gcc --version
gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) |
Beta Was this translation helpful? Give feedback.
-
resolved for me : #2529 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
For those who are unable to install the older GCC with
I've updated the wiki as well. Installing GCC v14 should not be needed. This works because GCC v15 upgraded the default mode from gnu17 to gnu23. Additionally, this PR fixes installation of Ruby 2.7, 3.0, and 3.1 on Fedora 42 so no hacks are needed.
|
Beta Was this translation helpful? Give feedback.
For those who are unable to install the older GCC with
dnf
on the atomic desktop Fedoras (Universal Blue spins, Aurora, Bazzite, BlueFin, and uCore) you can supply the-std=gnu17
flag toCFLAGS
to have it use GCC v14 sytle compilation.I've updated the wiki as well. Installing GCC v14 should not be needed.
This works because GCC v15 upgraded the default mode from gnu17 to gnu23.
Additionally, this PR fixes installation of Ruby 2.7, 3.0, and 3.1 on Fedora 42 so no hacks are needed.
NOTE: This only works for Ruby 3.1. Older Rubies break for other reasons.UPDATE: This works as-is for Ruby 3.0, and 2.7 once a C++ compiler is installed (aside: why does…