2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

How to Install Elixir and Phoenix Framework on Ubuntu 21.04 LTS

Last updated at Posted at 2021-01-02

Node.js

check latest

https://github.com/nvm-sh/nvm/releases
2021/7はv0.38.0が最新なのでv0.38.0をインストールする。

Install nvm

export NVM_DIR="$HOME/.nvm" && (
  git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
  cd "$NVM_DIR"
  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"

Now add these lines to your ~/.bashrc, ~/.profile, or ~/.zshrc file to have it automatically sourced upon login: (you may have to add to more than one of the above files)

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

推奨版を確認する。
https://nodejs.org/ja/

(2021/7時点で推奨版は14.17.3LTS)

nvm install 14.17.3

Various installations

Required for Erlang

sudo apt-get update
sudo apt-get install automake autoconf libreadline-dev libncurses-dev \
libssl-dev libyaml-dev libxslt1-dev libffi-dev libtool unixodbc-dev \
libwxgtk3.0-gtk3-dev libgl1-mesa-dev  libglu1-mesa-dev libssh-dev xsltproc fop \
libxml2-utils

sudo apt-get -y install build-essential libncurses5-dev openssl
sudo apt-get install curl git-core

sudo apt-get install openjdk-15-jdk default-jdk

Required for Phoenix

sudo apt-get -y install inotify-tools

Install kerl

cd /tmp
sudo curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
sudo chmod a+x kerl
sudo mv kerl /usr/local/bin

Install Erlang/OTP

kerl list releases
kerl build 23.3.4.4 23.3.4.4

kerl install 23.3.4.4 ~/erlang/23.3.4.4

Activate Erlang/OTP

. ~/erlang/23.3.4.4/activate
echo 'export PATH="$HOME/erlang/23.3.4.4/bin:$PATH"' >> ~/.bashrc

Install kiex

cd /tmp
git clone https://github.com/taylor/kiex.git
cd kiex
echo 'export PATH="$HOME/.kiex:$PATH"' >> ~/.bashrc
source ~/.bashrc
./install
source $HOME/.kiex/scripts/kiex
vi ~/.bashrc
~/.bashrc
source $HOME/.kiex/scripts/kiex

を追記します。

Install elixir

kiex list known
kiex install 1.11.4
kiex use 1.11.4 --default

Install Hex and Rebar

mix local.hex --force
mix local.rebar --force

Install Phoenix

mix archive.install hex phx_new 1.5.7
mix phx.new -v

参考:Elixir/Phoenix 初級① 第3版: はじめの一歩 (OIAX BOOKS)
https://www.amazon.co.jp/exec/obidos/ASIN/B01N2K6UBZ/oiax-22/ref=nosim

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?