:observer.start` crashes (maybe) due to erlang version mismatch

I have an issue similar to :observer.start crashes Erlang VM

Below is my error message.

iex(3)> :observer.start
   'dlopen(/Users/x/.asdf/installs/erlang/22.0.7/lib/wx-1.8.8/priv/wxe_driver.so, 2): Library not loaded: /usr/local/opt/wxmac/lib/libwx_osx_cocoau_stc-3.0.dylib\n  Referenced from: /Users/x/.asdf/installs/erlang/22.0.7/lib/wx-1.8.8/priv/wxe_driver.so\n  Reason: image not found'},
    {:wxe_server, :start, 1,
     [file: 'wxe_server.erl', line: 65]},
    {:wx, :new, 1, [file: 'wx.erl', line: 115]},
    {:observer_wx, :init, 1,
     [file: 'observer_wx.erl', line: 107]},
    {:wx_object, :init_it, 6,
     [file: 'wx_object.erl', line: 372]},
    {:proc_lib, :init_p_do_apply, 3,
     [file: 'proc_lib.erl', line: 249]}

The error message shows I am using erlang 22.

But, my .tool-versions shows;

My erlang 23.2.7
elixir 1.11.4-otp-23

And, I have installed several elixir/erlang versions using asdf;

❯ asdf list elixir
❯ asdf list erlang

Clearly there is a mismatching between .tool-versions and the erlang version in the error message. How to match it?

If I try to match them, then there arises the same issue as :observer.start() broken after updating wxWidgets, but can’t solve the issue using the suggested solution in the topic.

Any suggestion shall be appreciated. Thank you egze for the comment before.

Thanks! :smiley:

I am following the suggestion segmentation fault when starting observer (macOS Big Sur) · Issue #183 · asdf-vm/asdf-erlang · GitHub

The suggestion said some steps and lastly ‘recompile erlang’. My question is how to recompile erlang?

I have followed the steps.

brew edit cdalvaro/tap/wxmac
Remove the bottle do block
Add "--enable-compat28", to the args list in install
brew install cdalvaro/tap/wxmac

Then, removed the current erlang 23.2.7, and tried reinstall it.

❯ asdf install erlang 23.2.7
asdf_23.2.7 is not a kerl-managed Erlang/OTP installation
No build named asdf_23.2.7
Extracting source code
Building Erlang/OTP 23.2.7 (asdf_23.2.7), please wait...
APPLICATIONS DISABLED (See: /Users/x/.asdf/plugins/erlang/kerl-home/builds/asdf_23.2.7/otp_build_23.2.7.log)
 * jinterface     : No Java compiler found

DOCUMENTATION INFORMATION (See: /Users/x/.asdf/plugins/erlang/kerl-home/builds/asdf_23.2.7/otp_build_23.2.7.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

received sigint, cleaning up

Failed to install. Any suggestion to reinstall or recompile erlang?
The erlang still works in my computer.

1 Like


The problem was I created and edited a .tool-versions file in home directory(~/.tool-versions) rather than /Users/user-name/.tool-versions file.
The former file has;

elixir 1.11.4-otp-23
erlang 23.2.7

But, the latter has,

elixir 1.11.4-otp-23
erlang 22.0.7

The problem was;

  1. macOS Big Sur has an issue related to wxwidgets, resulting :observer.start error. To alleviate it, wxmac with modified config should installed before erlang installation like,
brew edit cdalvaro/tap/wxmac
Remove the bottle do block
Add "--enable-compat28", to the args list in install
brew install cdalvaro/tap/wxmac
  1. write elixir and erlang version into .tool-versions file which is located in user directory, not home directory which I accidentally created.

Very long journey.

Thank you all.