:observer.start() broken after updating wxWidgets

:observer's color scheme was off for Dark Mode on Big Sur, so I googled and followed the steps here to fix it.

Afterwards when running iex I started getting:

>iex /usr/local/Cellar/elixir/1.11.3/bin/elixir: line 230: exec: erl: not found

I then ran brew reinstall elixir

Running iex now worked, however :observer.start() didn’t.

Any ideas?

Erlang/OTP 23 [erts-11.1.6] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Interactive Elixir (1.11.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :observer.start()

18:44:04.539 [error] WX Failed loading 'wxe_driver'@'/usr/local/Cellar/erlang/23.2.2/lib/erlang/lib/wx-1.9.2/priv'

   'dlopen(/usr/local/Cellar/erlang/23.2.2/lib/erlang/lib/wx-1.9.2/priv/wxe_driver.so, 2): Library not loaded: /usr/local/opt/wxmac/lib/libwx_osx_cocoau_stc-3.0.dylib\n  Referenced from: /usr/local/Cellar/erlang/23.2.2/lib/erlang/lib/wx-1.9.2/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: 404]},
    {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}
1 Like

Discovered asdf while troubleshooting. Reinstalled erlang, elixir using asdf and it seems to be working now.

1 Like

I have the same issue with Erlang/23.3.2, Elixir 1.11.4 on macOS BigSur 11.2.3, since wxWidgets fixed this macOS issue within 3.1.* but the available version from wxmac — Homebrew Formulae is , we have to manually modify local wxmac.rb file to use with the current latest version 3.1.5 of wxWidgets, here are my steps to resolve this issue, hope it can be useful for your reference.

1, run brew edit wxmac after changed as below:

index 60dd92c233..c94feb8e9c 100644
--- a/Formula/wxmac.rb
+++ b/Formula/wxmac.rb
@@ -1,10 +1,9 @@
 class Wxmac < Formula
   desc "Cross-platform C++ GUI toolkit (wxWidgets for macOS)"
   homepage "https://www.wxwidgets.org"
-  url "https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.5.1/wxWidgets-"
-  sha256 "440f6e73cf5afb2cbf9af10cec8da6cdd3d3998d527598a53db87099524ac807"
+  url "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2"
+  sha256 "d7b3666de33aa5c10ea41bb9405c40326e1aeb74ee725bb88f90f1d50270a224"
   license "wxWindows"
-  revision 1
   head "https://github.com/wxWidgets/wxWidgets.git"

   livecheck do
@@ -31,6 +30,7 @@ class Wxmac < Formula
   def install
     args = [
+      "--enable-compat28",
@@ -40,7 +40,7 @@ class Wxmac < Formula
-      "--enable-webkit",
+      #"--enable-webkit",

2, run brew upgrade wxmac --build-from-source to upgrade

3, you may need to reinstall Erlang/Elixir via brew.

4, Make sure the completed Xcode tool installed.

After the above operations, I can run :observer.start() in mix shell now.


FYI, upgrade to erlang/otp 24.

After remove wxmac and reinstall it via:

brew install wxmac --build-from-source,

it will also reinstall erlang@24 as a dependance, here are outputs:

➜  opt brew install wxmac --build-from-source
==> Downloading https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2
Already downloaded: /Users/xinz/Library/Caches/Homebrew/downloads/e710ca0c81f73106f235183a47ded957ebdaaea78b907e0bc30bfa1818b7b4ba--wxWidgets-3.1.5.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/wxmac/3.1.5 --enable-compat28 --enable-clipboard --enable-controls --enable-dataviewctrl --enable-display --enable-dnd --enable-graphics_ctx -
==> make install
🍺  /usr/local/Cellar/wxmac/3.1.5: 827 files, 24.9MB, built in 3 minutes 48 seconds
Removing: /Users/xinz/Library/Caches/Homebrew/wxmac-- (17.7MB)
==> No outdated dependents to upgrade!
==> Checking for dependents of upgraded formulae...
==> Reinstalling 1 broken dependent from source:
==> Downloading https://www.erlang.org/download/otp_doc_html_24.0.tar.gz
Already downloaded: /Users/xinz/Library/Caches/Homebrew/downloads/a774f4bf5144fbeefd4c3cd4266aac993a05385bcd9481186c21c1a7e8dd4656--otp_doc_html_24.0.tar.gz
==> Downloading https://github.com/erlang/otp/releases/download/OTP-24.0/otp_src_24.0.tar.gz
Already downloaded: /Users/xinz/Library/Caches/Homebrew/downloads/0fc28fdc3874040568c7cc887b496b65109863d413557394db44cc4e4befef4f--otp_src_24.0.tar.gz
==> Reinstalling erlang
==> ./configure --prefix=/usr/local/Cellar/erlang/24.0 --enable-dynamic-ssl-lib --enable-hipe --enable-shared-zlib --enable-smp-support --enable-threads --enable-wx --with-ssl=/usr/loca
==> make
==> make install
==> make docs DOC_TARGETS=chunks
==> make install-docs
==> Caveats
Man pages can be found in:

Access them with `erl -man`, or add this directory to MANPATH.
==> Summary
🍺  /usr/local/Cellar/erlang/24.0: 7,618 files, 483.3MB, built in 6 minutes 27 seconds
==> Caveats
==> erlang
Man pages can be found in:

Access them with `erl -man`, or add this directory to MANPATH.
➜  opt

It works for me to upgrade to erlang@24 by use brew.



About 2 days ago, brew formula wxmac renamed as wxwidgets and upgrade to use wxWidgets-3.1.5, if you had manually edited the wxmac.rb refer the above mentioned in your local path /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula, please remember to revert the changes in that folder, and then use brew to update and upgrade erlang will keep the :observer works well.

1 Like