Cannot start observer on macOS

Hello.
I am following the OTP and Mix tutorial and I got to the step where I need to start the observer using :observer.start. I am currently getting the following error:

Could not find 'wxe_driver.so' in: /Users/valio/.asdf/installs/erlang/23.2.1/lib/wx-1.9.2/priv

I have followed the instruction for installing erlang via asdf:

  1. Install wxmac using brew
  2. Install erlang using asdf

Still getting the error.
During the build process for erlang I see:

APPLICATIONS INFORMATION (See: /Users/valio/.asdf/plugins/erlang/kerl-home/builds/asdf_23.2.1/otp_build_23.2.1.log)
 * wx             : No OpenGL headers found, wx will NOT be usable
 * No GLU headers (glu.h) found, wx will NOT be usable

I am not sure if this is relevant.
I have tried reinstalling everything multiple times with no success.

Please help!

When installing erlang with asdf, which uses kerl under the hood, you will want to set some environment variables in your shells profile (example: .bash_profile) so that the installation can find programs like wx-config. Here is what I have set in my .bash_profile

export JAVAC="/usr/bin/javac"
export WX_CONFIG="/usr/local/bin/wx-config"
export KERL_CONFIGURE_OPTIONS="--with-javac=$JAVAC --with-wx-config=$WX_CONFIG"

To find the paths of javac and wx-config you can type which javac and which wx-config in your terminal. After setting these in your shell, reinstall erlang. Observer needs wx widgets because it is a graphical interface. With erlang installed knowing where to find wx-config, observer should work.

1 Like

Hi Logan. Unfortunately that didn’t work for some reason.
Here is what I did:

  1. uninstalled erlang using asdf uninstall erlang 23.2.1
  2. Checked the paths to javac and wx-config
  3. Added the variables to my shell
  4. Installed erlang using asdf install erlang latest
  5. I then run iex -S mix inside my project folder and try to run :observer.start

I get the same error.

In the build logs for erlang I see:

checking for debug build of wxWidgets... checking for wx-config... /usr/local/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=yes)... yes (version 3.0.5)
checking for wxWidgets static library... no
checking for standard build of wxWidgets... checking for wx-config... /usr/local/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=no)... yes (version 3.0.5)
checking for wxWidgets static library... no

Also, I have force uninstalled the erlang the comes with elixir when it is installed using brew.

I am on Elixir 1.11.3-otp-23 and Erlang 23.2.1, I have wxmac installed (at 3.0.5.1_1) and I don’t have to use any variables to have :observer.start() working.

Are you on the latest macOS? Did you do xcode-select --install after your last macOS upgrade?

1 Like

I faced a problem with the Mac OSx Big Sur.
And these were the steps I successfully set up!
I uninstall the wxmac:

brew uninstall wxmac

and reinstalled to build wxmac locally instead of installing already built binary using the extra flag:

brew install --build-from-source wxmac

Update the plugin erlang for asdf:

asdf plugin-update erlang

skip the java dependency during installation use:
export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"

and then install the last version of the Erlang:

asdf install erlang latest

and now when I try to run the :observer.start() it works!

3 Likes