Home
>_

Install Elixir phx

Seem to always have to google this whenever I pick up a new project. So here it is:

Install asdf:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
Add these lines to ~/.bashrc:
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"

Install the following to prepare:

sudo apt install git curl build-essential ncurses-dev libssl-dev

Run the following for the correct versions of Erlang and Elixir:

asdf plugin add erlang
asdf plugin add elixir
asdf install erlang 26.1.2
asdf install elixir 1.15.6
asdf global erlang 26.1.2
asdf global elixir 1.15.6
The install commands will take a bit longer, especially the Erlang install.
Then when you have finished, run:
elixir -v
Should show Erlang/OTP 24 and Elixir 1.15.4
Then to get Phoenix working:

mix archive.install hex phx_new

Then you should be able to start a new Phoenix project with:

mix phx.new project_name

And when creating the database access, try using this command to create the user:

sudo -u postgres createuser --interactive
Its worth creating a superuser here, as they may need to create extensions in the future.

31 Jul 2023, 4:08 p.m.

Home