The erlang observer tool is a fantastic tool for elixir developers to have in their toolbelt, unfortunately the default elixir install on Mac OS Big Sur is broken (actually it's one of the dependencies wxmac which is broken).
if you want to fix it and have it as sexy as the one below ;) read along
This post serves as a memory refresher for later installs and also to help anyone searching to solve this, hopefully it's detailed enough, let me know in the comments if anything isn't as accurate as it should be and feel free to share your insights as well.
What we are going to do
- Modify wxmac
- Clean up previous elixir/erlang install if any
- Install elixir properly with asdf
Modify wxmac
Pop open a terminal window and insert the following command (I'm assuming you use homebrew on a mac and that you use vscode but YMMV)
export HOMEBREW_EDITOR=code
brew edit wxmac
you'll need to change the version, the hash and the args, check the diff file below
With wxmac properly modified if you already have an elixir setup we will need to clear it, if not, skip the next section and let’s proceed to install it properly
Remove previous elixir setup (skip if you have never ever setup elixir previously)
brew uninstall elixir
brew uninstall erlang
brew uninstall wxmac
Install it properly (feel free to update the versions)
brew install --build-from-source wxmac
export KERL_BUILD_DOCS="no"
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"
export CFLAGS="-O2 -g -fno-stack-check -Wno-error=implicit-function-declaration"
brew install asdf
asdf plugin add erlang
asdf plugin add elixir
asdf install erlang latest
asdf install elixir latest
asdf global erlang 23.1
asdf global elixir 1.10.4-otp-23
That's all folks!
Top comments (3)
Thank you for this.
Is this possible to do without using asdf?
Yes, it is possible to do this without using asdf.
During the build/install step, I did the following:
using:
Wxmac version 3.1.5
Elixir 1.12.1 (compiled with Erlang/OTP 24)
Should be possible as it is a problem with the WxWidgets library on mac but honestly I haven't tested it without asdf