Skip to content

Instantly share code, notes, and snippets.

@ricardopadua
Last active December 20, 2023 14:17
Show Gist options
  • Save ricardopadua/1cff35f8c2a9fad7f6c815be44b47292 to your computer and use it in GitHub Desktop.
Save ricardopadua/1cff35f8c2a9fad7f6c815be44b47292 to your computer and use it in GitHub Desktop.
Installing Elixir and Erlang With ASDF ( Fedora )
#!/bin/bash
## Ricardo Pádua
## install asdf in fedora
## install curl and git
dnf install curl git
## install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0
## add the following to ~/.bashrc:
echo . '$HOME'/.asdf/asdf.sh >> ~/.bashrc
echo . '$HOME'/.asdf/completions/asdf.bash >> ~/.bashrc
## add the following to ~/.zshrc:
#echo . '$HOME'/.asdf/asdf.sh >> ~/.zshrc
#!/bin/bash
## Ricardo Pádua
## before asdf install
## CentOS & Fedora
##install the build tools
yum groupinstall -y 'Development Tools' 'C Development Tools and Libraries'
##automatic configure script builder
yum install -y autoconf
##needed for terminal handling
yum install -y ncurses-devel
##for building with wxWidgets (start observer or debugger!)
yum install -y wxGTK3-devel wxBase3
##for building ssl
yum install -y openssl-devel
##for jinterface
yum install -y java-1.8.0-openjdk-devel
##ODBC support
yum install -y libiodbc unixODBC-devel.x86_64 erlang-odbc.x86_64
##for the documentation to be built
yum install -y libxslt fop
## ASDF uses a plugin system to support multiple languages. For a typical Elixir
## project, you will need the Elixir and Erlang plugins:
asdf plugin add erlang
asdf plugin add elixir
## With ASDF and its plugins installed, you can now install Elixir and Erlang.
## If your project has a .tool-versions file with entries for elixir and erlang,
## you can install the correct versions by running the following from inside the project
asdf install
## to see a list of all available versions
asdf list-all erlang
## Unlike other version managers, ASDF requires you to specify a precise version
## of the language to install. To install version 23.3.4.10 of Erlang, run:
asdf install erlang 23.3.4.10
## to see a list of all available versions
asdf list-all elixir
## Notice that each Elixir release has multiple versions compiled with
## different major versions of Erlang/OTP. To maximize compatibility between
## Elixir and the Erlang runtime, choose a -otp-XY version that matches the
## major version of the runtime you installed in the previous step. For example:
asdf install elixir 1.11.2-otp-23
##to set a local version
asdf local erlang 23.2.1
asdf local elixir 1.11.2-otp-23
##to set a global, or default, version
#asdf global erlang 23.2.1
#asdf global elixir 1.11.2-otp-23
@threeaccents
Copy link

Thank you for this!

@ricardopadua
Copy link
Author

Installing Erlang 24.0 on Ubuntu 20.04 based on the current asdf advised package prerequisites results in the following error message:

wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed

One of the new features of Erlang 24.0 is the addition of support for wxWebView.

https://www.erlang.org/downloads/24.0

wx
The application has been completely rewritten in order
to use wxWidgets version 3 as its base.
Added support for wxWebView.
The asdf Erlang installation instructions for Ubuntu 20.04 mention only the prerequisite package libwxgtk3.0-gtk3-dev. If only this package is installed, the following error message is displayed upon installing Erlang 24.0 using asdf:

asdf install erlang 24.0

Building Erlang/OTP 24.0 (asdf_24.0), please wait...
APPLICATIONS INFORMATION (See: ~/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_build_24.0.log)

  • wx : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
    After installing the libwxgtk-webview3.0-gtk3-dev package, this error no longer occurs.

I would propose changing the asdf Erlang installation instructions for Ubuntu 20.04 from

If you want to install all the above: apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

to

If you want to install all the above: apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

Note the addition of the libwxgtk-webview3.0-gtk3-dev package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment