简体   繁体   中英

wxmac elixir error when trying to run :observer.start in iex

After running :observer.start in iex I received the follwing messages. I tried uninstalling and reinstalling both Elixir and Homebrew but to no avail.

objc[58977]: Class wxNSProgressIndicator is implemented in both /usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib (0x1f5e9fc0) and /usr/local/opt/wxmac/lib/libwx_osx_cocoau_core-3.0.dylib (0x1ef61fc0). One of the two will be used. Which one is undefined.

objc[58977]: Class wxNSTableDataSource is implemented in both /usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib (0x1f5ea038) and /usr/local/opt/wxmac/lib/libwx_osxzsh: segmentation fault

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

and then install the last version of the Erlang:

asdf install erlang latest

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

Observer uses WXwidgets to render the window and the controls on your platform. As the error suggests you have 2 installations, not sure how you handle such errors on mac but I suppose deleting one of the versions will solve the error.

To make your life easier, there is now a new option to run observer in browser called Phoenix Live Dashboard that does not require any local renderer dependencies installed.

Pass extra flag to brew install to build wxmac locally instead of installing already built binary.( There seems to be a bug in bigsur wxmac bottle ). Elixir has dependency on Erlang which in turn has dependency on wxmac to show observer window. So execute this first before installing erlang or elixir.

brew install --build-from-source wxmac

It seems like all of the dylib files are exact duplicates of each other in /usr/local/opt/wxmac/lib . This might be a problem with how the dylibs are installed for wxmac but I don't have the patience to follow up on that right now. Perhaps someone with more knowledge than I knows how to fix the wxmac brew formula?

It's a bit of a hack but I found that manually symlinking all of the dylib's in the directory fixed the problem for me. For example,

cd /usr/local/opt/wxmac/lib
rm libwx_osx_cocoau_core-3.0.dylib
ln -s libwx_osx_cocoau_core-3.0.0.5.0.dylib libwx_osx_cocoau_core-3.0.dylib
# repeat for any/all libs that are a problem (I did all of them)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM