Home > OS >  How to debug Elixir with erlangs GUI debugger on Ubuntu-based linux?
How to debug Elixir with erlangs GUI debugger on Ubuntu-based linux?

Time:03-24

I installed Erlang and Elixir as recommended in the Elixir documentation for Ubuntu & Debian.

The results of running elixir -v:

Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit]

Elixir 1.13.0 (compiled with Erlang/OTP 24)

When I enter iex and try to start the debugger GUI with :debugger.start(), I get the following error:

12:22:51.248 [error] WX ERROR: Could not load library: :load_failed
Failed to load NIF library /usr/lib/erlang/lib/wx-2.1.1/priv/wxe_driver: 'libwx_gtk3u_webview-3.0.so.0: cannot open shared object file: No such file or directory'
{:error,
 {{:error,
   {:load_failed,
    'Failed to load NIF library /usr/lib/erlang/lib/wx-2.1.1/priv/wxe_driver: \'libwx_gtk3u_webview-3.0.so.0: cannot open shared object file: No such file or directory\''}},
  [
    {:wxe_server, :start, 1, [file: 'wxe_server.erl', line: 65]},
    {:wx, :new, 1, [file: 'wx.erl', line: 115]},
    {:dbg_wx_win, :init, 0, [file: 'dbg_wx_win.erl', line: 46]},
    {:dbg_wx_mon, :init, 3, [file: 'dbg_wx_mon.erl', line: 114]}
  ]}}

I checked the path /usr/lib/erlang/lib/wx-2.1.1/priv/ and found wxe_driver.so there.

CodePudding user response:

I found that the missing object file that was referenced, libwx_gtk3u_webview-3.0.so.0, is included in this package's filelist.

I installed the package with

sudo apt install libwxgtk-webview3.0-gtk3-0v5

and now :debugger.start() and :observer.start() launch their respective GUIs.

I answered my own question in the hopes that it'll help others and my future self. Anyone with further insight into why this package was missing from my installation and is not referenced anywhere in the Erlang or Elixir installation documentation, please add an answer or comment. I'm wondering if I missed something during the initial installation because I haven't found other reports of this issue.

  • Related