Search code examples
rubyasdf-vm

autoconf: command not found


I'm trying to install ruby 2.8.0-dev through asdf with asdf install ruby 2.8.0-dev but I get the following error:

Cloning https://github.com/ruby/ruby.git...
Installing ruby-master...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20200401)

Inspect or clean up the working tree at /tmp/ruby-build.20200523221649.37283.rxnWxu
Results logged to /tmp/ruby-build.20200523221649.37283.log

Last 10 log lines:
/tmp/ruby-build.20200523221649.37283.rxnWxu ~
Cloning into 'ruby-master'...
/tmp/ruby-build.20200523221649.37283.rxnWxu/ruby-master /tmp/ruby-build.20200523221649.37283.rxnWxu ~
/home/carlos/.asdf/plugins/ruby/ruby-build/bin/ruby-build: line 622: autoconf: command not found

I'm on Ubuntu 20.04

I've googled this but didn't found any useful info.

Best regards.


Solution

  • First, some general advice how you can solve this issue yourself, without having to come to [so] and waiting for someone else to solve your problem:

    Computers are very good at searching. So, in 90% of cases, when a computer tells you that it couldn't find something, it is because that thing isn't there.

    So, the first thing I would check, if I were in your situation, is whether the thing the computer tells me it can't find is actually there. In particular, I would check whether I have autoconf installed.

    In the other 10% of cases, the thing the computer is looking for is there, but it is not somewhere the computer is looking. So, the second thing I would check is whether autoconf is in the $PATH.

    Pretty much always, following those two steps solves the problem for me.

    Now, on to your particular problem: when you want to compile some piece of software, you need the corresponding tools. Those tools include, but are not limited to, a compiler for the language the software is written in (in this case C), a build tool (in this case Make), the header files for all the libraries the software uses (in this case for example libyaml, zlib, OpenSSL), maybe some configuration tools (in this case autoconf). YARV also uses Bison to generate its parser.

    Often, those required tools are listed in the developer or contributor documentation of the software. Although sometimes, it is just assumed that people who install software by compiling directly from source are clever enough to figure out which tools they need on their own. For YARV, there is documentation about the requirements for running the testsuite, which implicitly also requires building the code in the first place.

    Debian-based Linux Distributions (Debian, Ubuntu, Mint, etc.) have a handy meta-package called build-essential that depends on some of the most important tools, e.g. gcc and make as well as the dpkg-dev metapackage (which in turn depend on lots of other packages).

    The ASDF Ruby plugin actually uses ruby-build under the hood, and the documentation directly links to the system requirements, which list the following:

    apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev