Deploying to Heroku - libtinfo.so.5

Im trying to deploy my app but get this error:

-----> Installing Hex
/app/.platform_tools/erlang/erts-11.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
-----> Installing rebar
/app/.platform_tools/erlang/erts-11.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
-----> Fetching app dependencies with mix
/app/.platform_tools/erlang/erts-11.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
 !     Push rejected, failed to compile Elixir app.
 !     Push failed
   * Erlang 23.3.2
   * Elixir v1.12.2 

What am I doing wrong?

I don’t know about the specifics of deploying to Heroku, but in general this means you’re missing a library.

A similar example of this errror happens if you compile on one OS but your target OS is different e.g., you compile on ubuntu but deploy using alpine.

Here’s a good resource that explains it far better than I ever could: Cross-compiling Elixir releases with ASDF and Docker

Edit: this could also be very useful: GitHub - bitwalker/distillery: Simplify deployments in Elixir with OTP releases!

For libtinfo.so.5 it’s more specifically ncurses.

1 Like