I've been having trouble building Ruby 3.0 under Ubuntu 18.04.
I started by cloning the source repository, and building the head of the main branch.
Six extension libraries failed to build: dbm, gdbm, openssl, fiddle, readline, and zlib.
Openssl was my main concern, since I can't run "gem install" without it.
I was following the instructions in the main ruby repository's ReadMe, which were pretty good up to a point (the very point that I was now at). What they have to say at this point is _really_ not helpful:
Some extension libraries may not get compiled because of lack of
necessary external libraries and/or headers, then you will need to
run 'make distclean-ext' to remove old configuration after
installing them in such case.
Not helpful point #1: There are no links or advice to help me find the "lacking" external libraries or headers. I'm left to do an unanticipated research project without any guidance.
Not helpful point #2: What is the use of 'make distclean-ext'? My understanding of Make conventions, and the listing I got from running it show that its purpose is to return _all_ of the extension subdirectories to their pristine, pre-make state. It certainly doesn't single out or do anything special to the extensions that did not build, and it undoes useful work in the extensions that did build. It doesn't appear that any of this would be helpful in getting the any of the broken builds fixed, yet it is recommended as part of the solution, without any guidance as to how it might help.
So I started on my six unanticipated research projects. There are "mkmf.log" files in the extension directories to give me some clues. In the openssl case, there were two unresolved references, "t_open() in -lnsl" and "socket() in -lsocket". So far so good. There is also a suggestion to add the control flag "--with-openssl-dir-<dir>" to something unspecified. The "make" command line? the "./config" command line? one of the generated configuration files? I'm willing to do only so much trial and error to figure out something I could have been told.
I also verified that openssl (version 1.1.1f, 31 Mar 2020) is installed on my machine in /usr/lib/ssl. That's a fairly obvious place to look. Why is it necessary for me to tell the Ruby build something that should be obvious?
I eventually took note of the little icons at the top of the README.md file. There is one for each operating system that give it a "passing" or "failing" grade. The head of the main branch showed a "failing" grade for Ubuntu. So, I thought, let me back up to a more stable place with a passing grade. So I looked at the "ruby_3_0" branch. It indeed has a passing grade for Ubuntu. So I switched to that branch and started over.
S A M E R E S U L T
I have so far wasted two days on something that should have taken hours to resolve at most. Needless to say, I'm upset. Can anyone tell me what I missed that would have saved me all this aggravation?
\-\- Jens Dill \(hopeful Ruby developer\)
P.S. Some of what I say here is worth reporting as an issue with the Ruby installation instructions. I don't see an obvious place to report such issues officially. I don't really want to clutter up the stream of real bug reports at this time. Is there a place I should send this?