Skip to content

Instantly share code, notes, and snippets.

@unixc3t
Forked from rubencaro/install_elixir.md
Created July 24, 2017 09:35
Show Gist options
  • Save unixc3t/92144dab8895f43467fad600c1509547 to your computer and use it in GitHub Desktop.
Save unixc3t/92144dab8895f43467fad600c1509547 to your computer and use it in GitHub Desktop.
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

Install needed system packages

Fedora

# install system build packages
sudo dnf install make automake gcc gcc-c++ kernel-devel git wget openssl-devel ncurses-devel wxBase3 wxGTK3-devel m4

# for Fedora up to 24, to make wxWidgets3 visible to erlang (to build Erlang Observer)
# not needed on Fedora 25 and up
mkdir -p ~/.local/bin
cd ~/.local/bin
ln -s /usr/bin/wx-config-3.0 wx-config
ln -s /usr/bin/wxrc-3.0 wxrc

Ubuntu

sudo apt-get install build-essential git wget libssl-dev libreadline-dev libncurses5-dev zlib1g-dev m4 curl wx-common libwxgtk3.0-dev autoconf

Install asdf and its plugins

asdf lives in https://github.com/asdf-vm/asdf

Follow its installation instructions, which at the moment of writing were:

cd
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.3.0

# For Ubuntu or other linux distros
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

On a new terminal, install Erlang and Elixir plugins:

asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git

Install Erlang and Elixir

asdf install erlang 20.0
asdf install elixir 1.4.5

Then set them as the global version:

asdf global erlang 20.0
asdf global elixir 1.4.5

Now you can open a new terminal and try erl:

$ erl
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] 

Eshell V9.0  (abort with ^G)
1> 

Or start Erlang Observer by erl -s observer start.

And you can try 'iex':

$ iex
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] 

Interactive Elixir (1.4.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>

Use asdf .tool-versions file to manage which version is active on each of your projects.

Enjoy!

@unixc3t
Copy link
Author

unixc3t commented Jul 24, 2017

everything is ok in linux mint 18.2 cinnamon edition 64bit

This is my problem and solution

error:

documentation :
xsltproc is missing.
fop is missing.
xmllint is missing.
The documentation can not be built.
slove: sudo apt-get install libxml2-utils xsltproc fop

error:
odbc : ODBC library – link check failed

slove: sudo apt-get install unixodbc unixodbc-bin unixodbc-dev

error
encounter the similar fail,
the following:
make[2]: Entering directory /root/software/otp_src_R15B02/lib/jinterface' === Entering application jinterface make[3]: Entering directory/root/software/otp_src_R15B02/lib/jinterface/java_src'
make[4]: Entering directory /root/software/otp_src_R15B02/lib/jinterface/java_src/com/ericsson/otp/erlang' if [ ! -d "/root/software/otp_src_R15B02/lib/jinterface/priv/" ];then mkdir "/root/software/otp_src_R15B02/lib/jinterface/priv/"; fi /bin/sh: 1: jar: not found make[4]: *** [/root/software/otp_src_R15B02/lib/jinterface/priv/OtpErlang.jar] Error 127 make[4]: Leaving directory/root/software/otp_src_R15B02/lib/jinterface/java_src/com/ericsson/otp/erlang'
make[3]: *** [opt] Error 2
make[3]: Leaving directory /root/software/otp_src_R15B02/lib/jinterface/java_src' make[2]: *** [opt] Error 2 make[2]: Leaving directory/root/software/otp_src_R15B02/lib/jinterface'
make[1]: *** [opt] Error 2
make[1]: Leaving directory `/root/software/otp_src_R15B02/lib'
make: *** [tertiary_bootstrap_build] Error 2

slove: you must install jdk or jre ,I install jdk and config jdk ,you must can use javac and java in console

@unixc3t
Copy link
Author

unixc3t commented May 25, 2019

sudo pacman -S unixodbc
sudo pacman -S wxgtk3

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