Crystal libevent-2.0.so.5: cannot open shared object file

Today I upgraded my Ubuntu to 18.04.

Compiling a file with Crystal gives me the following error:

stderr:

    /root/.cache/crystal/usr-share-crystal-src-ecr-process.cr/macro_run: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

The library in question, libevent-2.0.so.5 has been superseded by libevent-2.1.so.6 => /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6

Crystal is of course aware of this and will link against the new shared library; unfortunately there are still cached files in the directory.

Therefore removing the cached files should do the trick:

rm –r /root/.cache